UML Association vs Aggregation vs Composition - Javatpoint
文章推薦指數: 80 %
Aggregation is a subset of association, is a collection of different things. It represents has a relationship. It is more specific than an association. It ... ⇧SCROLLTOTOP Home Java UML Pandas Python Java SQL Android Cloud JavaScript Servlet JSP Struts2 Spring Quiz Projects InterviewQ Comment Forum Training UMLTutorial UMLTutorial UMLBuildingBlocks UMLArchitecture UMLDiagrams UMLRelationship AssociationvsAggregationvsComposition UMLAssociation UMLDependency UMLGeneralization UMLRealization UMLClassDiagram UMLObjectDiagram UMLComponentDiagram UMLDeploymentDiagram UMLInteractionDiagram UMLUseCaseDiagram UMLSequenceDiagram UMLCollaborationDiagram UMLStateMachineDiagram UMLActivityDiagram UMLTimingDiagram UMLTools next→ ←prev UMLAssociationvs.Aggregationvs.Composition InUMLdiagrams,relationshipsareusedtolinkseveralthings.Itisaconnectionbetweenstructural,behavioral,orgroupingthings.FollowingarethestandardUMLrelationshipsenlistedbelow: Association Dependency Generalization Realization Association Associationrelationshipisastructuralrelationshipinwhichdifferentobjectsarelinkedwithinthesystem.Itexhibitsabinaryrelationshipbetweentheobjectsrepresentinganactivity.Itdepictstherelationshipbetweenobjects,suchasateacher,canbeassociatedwithmultipleteachers. Itisrepresentedbyalinebetweentheclassesfollowedbyanarrowthatnavigatesthedirection,andwhenthearrowisonbothsides,itisthencalledabidirectionalassociation.Wecanspecifythemultiplicityofanassociationbyaddingtheadornmentsonthelinethatwilldenotetheassociation. Example: 1)Asingleteacherhasmultiplestudents. 2)Asinglestudentcanassociatewithmanyteachers. Thecompositionandaggregationaretwosubsetsofassociation.Inbothofthecases,theobjectofoneclassisownedbytheobjectofanotherclass;theonlydifferenceisthatincomposition,thechilddoesnotexistindependentlyofitsparent,whereasinaggregation,thechildisnotdependentonitsparenti.e.,standalone.Anaggregationisaspecialformofassociation,andcompositionisthespecialformofaggregation. Aggregation Aggregationisasubsetofassociation,isacollectionofdifferentthings.Itrepresentshasarelationship.Itismorespecificthananassociation.Itdescribesapart-wholeorpart-ofrelationship.Itisabinaryassociation,i.e.,itonlyinvolvestwoclasses.Itisakindofrelationshipinwhichthechildisindependentofitsparent. Forexample: Hereweareconsideringacarandawheelexample.Acarcannotmovewithoutawheel.Butthewheelcanbeindependentlyusedwiththebike,scooter,cycle,oranyothervehicle.Thewheelobjectcanexistwithoutthecarobject,whichprovestobeanaggregationrelationship. Composition Thecompositionisapartofaggregation,anditportraysthewhole-partrelationship.Itdepictsdependencybetweenacomposite(parent)anditsparts(children),whichmeansthatifthecompositeisdiscarded,sowillitspartsgetdeleted.Itexistsbetweensimilarobjects. Asyoucanseefromtheexamplegivenbelow,thecompositionassociationrelationshipconnectsthePersonclasswithBrainclass,Heartclass,andLegsclass.Ifthepersonisdestroyed,thebrain,heart,andlegswillalsogetdiscarded. Associationvs.Aggregationvs.Composition Association Aggregation Composition Associationrelationshipisrepresentedusinganarrow. Aggregationrelationshipisrepresentedbyastraightlinewithanemptydiamondatoneend. Thecompositionrelationshipisrepresentedbyastraightlinewithablackdiamondatoneend. InUML,itcanexistbetweentwoormoreclasses. Itisapartoftheassociationrelationship. Itisapartoftheaggregationrelationship. Itincorporatesone-to-one,one-to-many,many-to-one,andmany-to-manyassociationbetweentheclasses. Itexhibitsakindofweakrelationship. Itexhibitsastrongtypeofrelationship. Itcanassociateonemoreobjectstogether. Inanaggregationrelationship,theassociatedobjectsexistindependentlywithinthescopeofthesystem. Inacompositionrelationship,theassociatedobjectscannotexistindependentlywithinthescopeofthesystem. Inthis,objectsarelinkedtogether. Inthis,thelinkedobjectsareindependentofeachother. Herethelinkedobjectsaredependentoneachother. Itmayormaynotaffecttheotherassociatedelementifoneelementisdeleted. Deletingoneelementintheaggregationrelationshipdoesnotaffectotherassociatedelements. Itaffectstheotherelementifoneofitsassociatedelementisdeleted. Example:Atutorcanassociatewithmultiplestudents,oronestudentcanassociatewithmultipleteachers. Example:Acarneedsawheelforitsproperfunctioning,butitmaynotrequirethesamewheel.Itmayfunctionwithanotherwheelaswell. Example:Ifafileisplacedinafolderandthatisfolderisdeleted.Thefileresidinginsidethatfolderwillalsogetdeletedatthetimeoffolderdeletion. NextTopicUMLAssociation ←prev next→ ForVideosJoinOurYoutubeChannel:JoinNow Feedback SendyourFeedbackto[email protected] HelpOthers,PleaseShare LearnLatestTutorials Splunk SPSS Swagger Transact-SQL Tumblr ReactJS Regex ReinforcementLearning RProgramming RxJS ReactNative PythonDesignPatterns PythonPillow PythonTurtle Keras Preparation Aptitude Reasoning VerbalAbility InterviewQuestions CompanyQuestions TrendingTechnologies ArtificialIntelligence AWS Selenium CloudComputing Hadoop ReactJS DataScience Angular7 Blockchain Git MachineLearning DevOps B.Tech/MCA DBMS DataStructures DAA OperatingSystem ComputerNetwork CompilerDesign ComputerOrganization DiscreteMathematics EthicalHacking ComputerGraphics SoftwareEngineering WebTechnology CyberSecurity Automata CProgramming C++ Java .Net Python Programs ControlSystem DataMining DataWarehouse JavatpointServicesJavaTpointofferstoomanyhighqualityservices.Mailuson[email protected],togetmoreinformationaboutgivenservices.WebsiteDesigningWebsiteDevelopmentJavaDevelopmentPHPDevelopmentWordPressGraphicDesigningLogoDigitalMarketingOnPageandOffPageSEOPPCContentDevelopmentCorporateTrainingClassroomandOnlineTrainingDataEntryTrainingForCollegeCampusJavaTpointofferscollegecampustrainingonCoreJava,AdvanceJava,.Net,Android,Hadoop,PHP,WebTechnologyandPython.Pleasemailyourrequirementat[email protected]Duration:1weekto2weekLike/Subscribeusforlatestupdatesornewsletter
延伸文章資訊
- 1【UML】Class Diagram 類別圖(下):Relationships 關係
Relationships 關係. Instance-level 物件層級. Dependency 依賴; Association 關聯; Aggregation 聚合; Composition...
- 2UML Association vs Aggregation vs Composition | EdrawMax
Aggregations Represented in a UML Diagram ... Aggregation is an association in which the entities...
- 3Aggregation relationships in UML models - IBM
In UML models, an aggregation relationship shows a classifier as a part of or subordinate to anot...
- 4UML Composition
UML composite aggregation (composition) relationship means that at most one composite object has ...
- 5UML Association vs Aggregation vs Composition - Javatpoint
Aggregation is a subset of association, is a collection of different things. It represents has a ...