PrepAway - Latest Free Exam Questions & Answers

What should be done when a class has a larger number of responsibilities, and consequently more operations and

What should be done when a class has a larger number of responsibilities, and consequently
more operations and attributes, than the other classes in the domain?

PrepAway - Latest Free Exam Questions & Answers

A.
Have the class keep its responsibilities and delegate the implementation to other classes, so
the behavior is more distributed.

B.
Merge code to reduce the number of operations.

C.
Add multiple subclasses to the class and distribute the operations and attributes evenly among
the class and subclasses.

D.
Refactor the class into several classes to better distribute the responsibilities and operations.


Leave a Reply