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

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:

主站蜘蛛池模板: 峡江县| 平陆县| 两当县| 石城县| 长兴县| 宝应县| 垣曲县| 蕉岭县| 公主岭市| 嘉定区| 册亨县| 兰考县| 忻州市| 鄄城县| 民和| 丁青县| 新竹市| 岑溪市| 桐乡市| 德阳市| 延吉市| 崇信县| 克山县| 商城县| 谢通门县| 五指山市| 永昌县| 东港市| 齐齐哈尔市| 凌云县| 湘潭市| 南昌县| 长垣县| 南雄市| 眉山市| 米林县| 阳东县| 平远县| 龙海市| 衢州市| 府谷县|