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
Java
Topic: Design pattern
Explain the Composite pattern?
Browse random answers:
What is the design pattern?
Do I have to use the design pattern?
How many design patterns?
What is the relationship among these patterns?
What is a software design pattern?
What is an analysis pattern?
What are the differences between analysis patterns and design patterns?
What is Singleton pattern?
Explain the Observer pattern?
Explain the Strategy and Template patterns?
Explain the Single Thread Execution pattern in concurrency patterns?
What are the structural patterns ?
Explain the Adapter pattern?
Expain the Proxy and Decorator patterns?
Explain the Composite pattern?
What are Behavioral patterns?
Explain the Observer pattern?
Explain the strategy and template patterns
Explain the concurrency patterns?
Explain the Single thread execution pattern?
Explain Design Patterns template?
Explain Patterns in Java template?