Escolar Documentos
Profissional Documentos
Cultura Documentos
In Object Oriented world, if one class has to communicate with any other class (or classes), it has to
communicate by using one of the Object Oriented Relationships.
Inheritance or Generalization
Aggregation
o Weak
o Strong (Also called as Composition or Containment)
Association
Association
Association represents a general binary relationship that describes an activity between two classes.
An association is illustrated using a solid line between the two classes with an optional label that
describes the relationship.
Association may have navigability, i.e. direction of the relation. Each class involved in the relationship
may have a role name played by the class in the relationship.
Examples
A student taking a course is an association between the Student class and the Course class.
A faculty member teaching a course is an association between the Faculty class and the Course
class.
Weak Aggregation
Weak Aggregation represents an ownership relationship between two classes. Aggregation models the
relationship like has-a.
Example
Customer has bank account.
Room has chairs.
Rules of Thumb
The whole and parts have coincident lifetimes.
Both classes represent physical items.
Examples
An engine is a part a car.
A package is a part of a shipment.
Employee is a part of a team.