Monday, July 23, 2007

Modeling Aggregation

In typical association each class remains independent of the other and neither class is superior to the other. They simply communicate.
In Aggregation defines a definite hierarchical relationship. It defines an assembly or configuration of elements to make a larger more complex unit. There has to be a point of control, a boss, one object that represent the interface to the assembly and assumes responsibility for coordinating the behavior of the aggregation.
An aggregation defines configuration so that the collection of objects can be managed as a single unit.


Figure 6-33: How to model an aggregation relationship

Figure 6-33 reads as follows:

-An agent may be a part of no more than one agency, but an agent does not have to be part of an agency (0..1), that is an agent may be independent.

-The agency is always comprised of at least one agent but there may be any number of agents (1..*).

-An agent is considered an employee (role name) of an agency.

-Every agent is constrained by the fact that she must have a current contract in order to be an employee of the agency.

No comments: