您的位置 首页 > 德语词汇

association是什么意思?用法、例句 英语单词Association, Aggregation, Composition的区别

大家好,关于association是什么意思?用法、例句很多朋友都还不太明白,今天小编就来为大家分享关于英语单词Association, Aggregation, Composition的区别的知识,希望对各位有所帮助!

1、Associationisarelationshipbetweentwoobjects,buttherelationshipbetweenthemcouldbemultipletypes.Itcouldbeone-to-one,one-to-many,many-to-one,many-to-many.Inotherwords,therelationshipisveryflexible(灵活的)andloose(松散的).

2、Insoftwareprogramming,anobjectmayusefunctionsprovidedbyanobjectofanotherclass,thiskindofrelationshipiscalledassociation.

association是什么意思?用法、例句 英语单词Association, Aggregation, Composition的区别

3、AggregationandCompositionaresubsetsofassociation.

4、Aggregationisasubset(子集)ofassociation.Itdepicts(描述)adirectional(有方向的)associationbetweentwoobjects,whichmeansitisanassociationthatrepresents(代表)apart-wholeorpart-ofrelationship.Butthisrelationshipisnottoorestrictive,whichmeanstwoobjectscanexistwithouteachother.

5、Compositionisasubsetofaggregation.Thisrelationshipismostrestrictive(严苛的),whichmeansitrepresentsanownership(拥有)relationship.Thecontained(被包含的)objectcannotexistwithouttheexistence(存在)ofcontainer(容器、拥有者)object.

6、TherelationshipbetweenCaranditsEngineiscalledComposition.BecauseitsEnginecannotbeusedinanyothercar.

7、汽车与专属的发动机之间的关系是Composition。因为发动机离开汽车后,将没有单独存在的意义。

8、TherelationshipbetweenClassroomandStudentsiscalledAggregation.Becauseeachonecanstillexistwithouteachother.

9、教室与学生之间的关系是Aggregation。因为一个教室可以包含多个学生,并且两者都可以独立存在。(估计大家会觉得一个学生也可以在多个教室上课,所以不是Aggregation。这个确实不同的角度分析有不同的看法。但我个人更认为是Aggregation,因为学生不能包含教室)

END,本文到此结束,如果可以帮助到大家,还望关注本站哦!

本站涵盖的内容、图片、视频等数据,部分未能与原作者取得联系。若涉及版权问题,请及时通知我们并提供相关证明材料,我们将及时予以删除!谢谢大家的理解与支持!

Copyright © 2023