Which two implementation details are necessary for the Cementmanager class?

You are designing a new subsystem to store and scratch for user commands in a fashion
company’s website. On class, CommentManager, is responsible for accessing comment data and
providing read-only access to other objects in the subsystem.
Which two implementation details are necessary for the Cementmanager class?

You are designing a new subsystem to store and scratch for user commands in a fashion
company’s website. On class, CommentManager, is responsible for accessing comment data and
providing read-only access to other objects in the subsystem.
Which two implementation details are necessary for the Cementmanager class?

A.
The storage mechanism implemented in CommentManager must be private to
CommentManager.

B.
All the accessor and mutator methods in CommentManager must have the static modifier in
their declarations.

C.
The comments must be assessable directly only within CommentManager.

D.
CommentManager should be a singleton object.



Leave a Reply 5

Your email address will not be published. Required fields are marked *


Reviewer

Reviewer

I’d have chosen A and B ?
Any good exaplanation for choosing C and D?

Ashishkumar

Ashishkumar

AD

A is correct – The storage mechanism implemented in CommentManager must be private to CommentManager-> It means CommentManager class will have private method to fetch the data and store value in public variable for read-only access to other objects in the subsystem..

D is correct – CommentsManager will give read only access of data to other objects so better to create singleton class with private mehtod to fetch all required data.