Which of the following is the BEST refactoring of the system to provide greatest flexibility?

Refer to the exhibit to answer the question.

Currently, the Person class is designed as shown in the Exhibit, with employees being paid a base
salary. New requirements are being added to pay bonuses to managers and commissions to
salespeople, leaving developers being paid a base salary as before. Which of the following is the
BEST refactoring of the system to provide greatest flexibility?

Refer to the exhibit to answer the question.

Currently, the Person class is designed as shown in the Exhibit, with employees being paid a base
salary. New requirements are being added to pay bonuses to managers and commissions to
salespeople, leaving developers being paid a base salary as before. Which of the following is the
BEST refactoring of the system to provide greatest flexibility?

A.
Associate the Person with EmployeeRole specializations, moving the payAmount( ) method as
shown in C.

B.
Replace the Person class with Developer, Salesman, and Manager classes, writing specific
payAmount( ) methods as shown in

C.
Extend the Person class and payAmount( ) method as shown in A.

D.
Create Developer, Salesman, and Manager specializations of the Person class, writing specific
payAmount( ) methods as shown in D.



Leave a Reply 0

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