Structure
- Component
- is the abstraction for all components, including composite ones
- declares the interface for objects in the composition
- (optional) defines an interface for accessing a component's parent in the recursive structure, and implements it if that's appropriate
- Leaf
- represents leaf objects in the composition .
- implements all Component methods
- Composite
- represents a composite Component (component having children)
- implements methods to manipulate children
- implements all Component methods, generally by delegating them to its children
Read more about this topic: Composite Pattern
Famous quotes containing the word structure:
“The question is still asked of women: How do you propose to answer the need for child care? That is an obvious attempt to structure conflict in the old terms. The questions are rather: If we as a human community want children, how does the total society propose to provide for them?”
—Jean Baker Miller (20th century)
“The structure was designed by an old sea captain who believed that the world would end in a flood. He built a home in the traditional shape of the Ark, inverted, with the roof forming the hull of the proposed vessel. The builder expected that the deluge would cause the house to topple and then reverse itself, floating away on its roof until it should land on some new Ararat.”
—For the State of New Jersey, U.S. public relief program (1935-1943)
“... the structure of a page of good prose is, analyzed logically, not something frozen but the vibrating of a bridge, which changes with every step one takes on it.”
—Robert Musil (18801942)