官术网_书友最值得收藏!

Aggregation

An aggregation is a special type of association. If inheritance is considered to be the is-a relationship, aggregation can be considered to be the HAS-A relationship.

Aggregation is used to describe a relation between two or more classes, when one class contains the other from a logical point of view, but instances of the contained class can live independently of the first class, outside of its context, or can be shared among other classes. For example, a Department HAS-A Teacher; additionally, every Teacher must belong to Department, but if a Department ceases to exist, a Teacher can still be active as shown in the following diagram:

主站蜘蛛池模板: 平和县| 京山县| 历史| 蓬莱市| 尚志市| 治多县| 苗栗市| 西林县| 磐安县| 闸北区| 灵武市| 新田县| 乌拉特后旗| 丰原市| 南召县| 舒兰市| 中江县| 汉阴县| 永泰县| 全州县| 利川市| 庆阳市| 望都县| 景洪市| 陵川县| 海安县| 望城县| 桃源县| 南溪县| 铜梁县| 永宁县| 屯门区| 峨边| 新巴尔虎右旗| 余江县| 平遥县| 大埔区| 易门县| 毕节市| 康定县| 沂源县|