Quiz

Composition Over Inheritance in Patterns

Understanding why many GoF design patterns favor composition over class inheritance.

Several GoF patterns (Strategy, Decorator, State) exist specifically to favor composition over inheritance. What is the primary design advantage this provides over solving the same problems with subclassing?