Composition as an alternative to inheritance many programs


Question: (Composition as an Alternative to Inheritance) Many programs written with inheritance could be written with composition instead, and vice versa. Rewrite class Base Plus Commission Employee of the Commission Employee-Base Plus Commission Employee hierarchy to use composition rather than inheritance. After you do this, assess the relative merits of the two approaches for designing classes Commission Employee and Base Plus Commission Employee, as well as for object-oriented programs in general. Which approach is more natural? Why?

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Composition as an alternative to inheritance many programs
Reference No:- TGS02405820

Now Priced at $10 (50% Discount)

Recommended (98%)

Rated (4.3/5)