Example of Design Pattern:
Classification and intent:
Composite is a structural design
pattern. Its intent is to compose objects into tree structures to
represent part-whole hierarchies. It lets clients treat individual objects
and compositions of objects uniformly.
Motivation:
Lesson presenter/planner of an educational system for individualized
learning may decide to build an agenda of the topics to be presented
during the lesson. Complex topics can be divided into simple elements like
concepts, text, graphics, and the like, or into a sequence of
subtopics. Each subtopic can be further divided into a lower level of
sequence of simple elements and other subtopics, producing an agenda like
in the following example:
1.  
Topic 
1
 
 
 
Text
 
 
 
Graphics
 
 
 
Concept A
 
 
 
1.1 
 
 
subtopic1.1
 
 
 
1.2 
 
 
subtopic1.2
 
 
 
 
 
 
 
 
Text
 
 
 
 
 
 
 
 
Concept 
B
 
 
 
 
 
 
 
 
1.2.1 
 
subtopic 
 
1.2.1
 
 
 
 
 
 
 
 
1.2.2 
 
subtopic 
 
1.2.2
2. 
 
Topic 
2