Please enable JavaScript.
Coggle requires JavaScript to display documents.
Object-Level Relationships (Association (Association is relation between…
Object-Level Relationships
Aggregation
It is a special form of Association
It represents Has-A relationship.
It is a unidirectional association i.e. a one way relationship. For example, department can have students but vice versa is not possible and thus unidirectional in nature.
In Aggregation, both the entries can survive individually which means ending one entity will not effect the other entity.
Developers use a hollow diamond to indicate aggregation
Code reuse is best achieved by aggregation.
Composition
Composition is a restricted form of Aggregation in which two entities are highly dependent on each other.
In composition, both the entities are dependent on each other.
When there is a composition between two entities, the composed object cannot exist without the other entity.
It represents part-of relationship.
Association
Association is relation between two separate classes which establishes through their Objects.
In Object-Oriented programming, an Object communicates to other Object to use functionality and services provided by that object.
Association can be one-to-one, one-to-many, many-to-one, many-to-many.
Composition and Aggregation are the two forms of association.
Association can be represented by a line between these classes with an arrow indicating the navigation direction.
Dependency
A change in a class affects the change in it's dependent class.
Example- Circle is dependent on Shape (an interface). If you change Shape , it affects Circle too. So, Circle has a dependency on Shape.
Dependency is represented by a dashed arrow starting from the dependent class to its dependency.
Dependency indicates that you may invoke one of the APIs of the received class reference and any modification to that class may break your class as well.