University of Computer Studies, Yangon Outlines Data Types Aggregation Classes Composition Describing Objects With Classes Association Classes Associations N-array Associations Generalization And Specialization Qualified Associations Inheritance Of Attributes And Interfaces Operations Templates Composition A strong form of aggregation The ‘part’ objects are dependent on the ‘whole’ objects in two ways i. a ‘part’ object can only belong to one composite at a time and, ii. when a composite object is destroyed, all its dependent parts must be destroyed at the same time
Figure 8.36 The Use of Composition
Composite Object Basic notion of composition is not strong enough to enforce certain natural properties of composite objects