Which pattern prescribes recursive composition for complex objects?
-
Composite Pattern
-
Strategy Pattern
-
Observer Pattern
-
Factory Pattern
A
Correct answer
Explanation
The Composite pattern allows you to compose objects into tree structures to represent part-whole hierarchies. It lets clients treat individual objects and compositions uniformly. 'Recursive composition' refers to composites that can contain other composites (nested structures), building complex objects from simpler ones using the same interface at every level.