Software design - Lecture 18. The main topics covered in this chapter include: relationships between classes; specialized form of association i-e weak association; assembling a class from other classes; aggregation and multiplicity; composition – container and contained classes;...
1 Software Design Lecture : 18 Relationships between Classes Ø Association –Discussed in Previous Lecture Ø Aggregation Ø Composition Ø Inheritance Aggregation or “ has –a “ relationship Ø Specialized form of association ie Weak Association Ø Assembling a class from other classes Ø Aggregation is a special type of relationship used Aggregation Ø In an aggregation relationship, the child class instance can outlive its parent class Ø Child class can be a part of multiple parent classes Ø To represent an aggregation relationship, you Example Aggregation Example Example Example – Aggregation and Multiplicity 10 Composition – Container and Contained classes Ø It’s a strong association. Ø It contain Objects that live and die together Ø The composition aggregation relationship is just another form of the aggregation relationship, but 11 Composition Continues Ø Another important feature of composition aggregation is that the part class can only be related to one instance of the parent class ...2 Relationships between Classes Ø Association –Discussed in Previous ? ?Lecture Ø Aggregation Ø Composition Ø Inheritance Aggregation or “ has –a “ relationship Ø Specialized form of association ie Weak