Java

Topic: Design pattern

Explain the Composite pattern?

The Composite pattern prescribes recursive composition for complex objects. Theintent is to allow all component objects to be treated in a consistent manner. Allobjects, simple and complex, that participate in this pattern derive from a commonabstract component class that defines common behavior.Forcing relationships into a part-whole hierarchy in this way minimizes the types ofobjects that our system (or client subsystem) needs to manage. A client of a paintprogram, for example, could ask a line to draw itself in the same way it would askany other object, including a composite object

Browse random answers: