Composite Pattern
9
Click here to load reader
-
Upload
melbournepatterns -
Category
Technology
-
view
1.151 -
download
0
description
An overview of the Composite Pattern form the GoF book.
Transcript of Composite Pattern
Structural Patterns - Composite
Melbourne Patterns Group July 1 2009Chris Bushell
Intent
Allow clients to treat primitive objects and containers in the same way
Graphics Example
• Line
• Rectangle
• Text
etc.
Graphics Example Continued
GraphicLineRectanglePicture
LineRectangle
Recursive Composition
Puzzle Example
Participants
• Component
• Leaf
• Composite
Participants
Code