Design Concepts  «Prev  

Weak and strong Aggregation

In strong aggregation a part entity cannot exist without the containing whole entity in the whole-part relationship. For example, university has multiple departments. This a composition relationship between the university and department entity. A department cannot exist on its own with out the university.

Modeling Composition

Composition is used for aggregations where the life span of the member object depends on the life span of the aggregate. The aggregate not only has control over the behavior of the member, but also has control over the creation and destruction of the member. In other words, the member object cannot exist apart from the aggregate. This greater responsibility is why composition is sometimes referred to as strong aggregation. Composition is a subset of aggregation, just as aggregation is a subset of association.

Object Solutions

Weak aggregation

Weak aggregation: Players may participate in many teams at the same time. For example, they can play for a city league and a company team. When a team is disbanded the players still exist and can be reassigned to other teams.

Strong aggregation or Composition

Strong aggregation or Composition: Chapters belong to a specific book. Without the book the chapters have no context and lose their meaning. If the book is deleted the chapters are deleted along with it. It does no good to keep them since they cannot be reassigned or reused in another book.