每次写一次这个就要翻一次 PPT,这次干脆记录下来,便于以后查看。
聚合(aggregation)
聚合 是一种特殊的 联系
An Aggregation can be defined as:
A special form of association that models a whole-part relationship between an aggregate (the whole) and its parts.
- Aggregation is used to model a whole-part relationship between model elements. There are many examples of whole-part relationships: a Library contains Books, Departments are made up of Employees, a Computer is composed of a number of Devices. To model an aggregation, the aggregate (Department) has an aggregation association to its constituent parts (Employee).
- A hollow diamond is attached to the end of an association path on the side of the aggregate (the whole) to indicate aggregation.
- An aggregation relationship that has a multiplicity greater than one for the aggregate is called shared. Destroying the aggregate does not necessarily destroy the parts. By impl