Aggregation and Composition

Aggregation

  • Aggregation is a special case of association where all objects have their own lifecycle.
  • It is represented by an empty diamond followed by a line.

  • aggregation
  • Aggregation represents 'whole-part' or 'a-part-of' relationship.
Example:
A relationship between 'Department' and 'Employee'. An 'Employee' may belong to multiple departments. Hence, the 'Employee' is a part of multiple departments. If we delete 'Department', the 'Employee' object will not destroy.

aggregation example

  • Aggregation shows their obvious difference in terms of strength of the relationship.
  • It implies a relationship where the child cannot exist independent of the parent.
  • When an object 'has-a' another object, then you have got an aggregation between them. Direction between them specified which object contains the other object.
  • It is also called as 'Has-a' relationship. There are no any restrictions.

Composition

  • Composition is a specialized form of aggregation.
  • Composition is a strong type of aggregation.
  • In composition relationship, child objects do not have their lifecycle without parent object.
  • If a parent object is deleted, all its child objects will also be deleted.
  • It represents 'death' relationship.
  • Composition is represented by filled diamond followed by a line.
composition

Example:
A relationship between House and Rooms. The house can contain multiple rooms there is no independent life of room and any room cannot belong to two different houses, if we delete the house, the room will automatically delete.

composition example

  • Composition is stronger than Aggregation.
  • An object associated with a composition relationship will not exist outside the containing object.
  • It implies a relationship where the child cannot exist independent of the parent.
  • It is also called as 'Is-a' relationship.
  • It is more restrictive.

Architecture Description Language

  • ADL stands for Architecture Description Language.
  • ADL is a notation specification that provides features for defining and modeling a software architecture.
  • It supports architecture components, their connections, interfaces and configurations for building the block of architecture description.
  • It is a formal specification language which describes the software features as well as hardware components.
Characteristics of ADL
  • ADL provides guidance to government and industry organizations.
  • It supports the routine use of existing designs and components in new application systems.
  • It supports the evaluation of an application system before it is built.