[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-655772-105":3,"detail-sidebar-cat-0-en-105":81,"doc-detail-655772-en":130,"doc-similar-655772":161},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":74,"head_meta":76,"extra_data":78,"updated_unix":80},105,"en","class-diagram-relationships-in-uml-with-examples-learn-how-to-build-correct-uml-class-diagram-relationships","Class Diagram Relationships in UML with Examples - Learn How to Build Correct UML Class Diagram Relationships","","Class Diagram Relationships in UML with Examples explains how to correctly identify and implement UML class diagram relationships in object-oriented modeling. It introduces class diagrams as the core building block, describing classes, their partitions (name, attributes, operations), and how classes encapsulate object data. The article then details major UML relationship types—association, directed association, reflexive association, multiplicity, aggregation, and composition—clarifying the meaning of cardinality and the lifecycle dependence differences between aggregation and composition.",{"@graph":14,"@context":73},[15,34,56],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/class-diagram-relationships-in-uml-with-examples-learn-how-to-build-correct-uml-class-diagram-relationships/655772/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/class-diagram-relationships-in-uml-with-examples-learn-how-to-build-correct-uml-class-diagram-relationships/655772.png","ImageObject",300,407,{"name":42,"@type":43},"Patrick","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-25","2026-10-25",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",6,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"What are UML class diagrams used to represent?","Question",{"text":63,"@type":64},"UML class diagrams represent the objects in a system, including their attributes, operations, and relationships among them.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"How does directed association differ from association in UML?",{"text":68,"@type":64},"Directed association is a directional relationship shown with a line and arrowhead, indicating a container-contained directional flow.",{"name":70,"@type":61,"acceptedAnswer":71},"What is the key difference between aggregation and composition?",{"text":72,"@type":64},"Aggregation emphasizes that the contained class is not strongly dependent on the container’s lifecycle, while composition emphasizes lifecycle dependence such that the contained class is destroyed when the container is destroyed.","https://schema.org",{"og:url":32,"og:type":75,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":77,"canonical":32},"index,follow",{"doc_id":79,"site_id":7},655772,1793052254,{"code":4,"msg":82,"data":83},"success",[84,88,92,96,101,104,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":85,"show_sort_weight":86,"slug":87},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":89,"show_sort_weight":90,"slug":91},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":93,"show_sort_weight":94,"slug":95},"Exam",70,"exam",{"id":97,"doc_module":4,"doc_module_name":25,"category_name":98,"show_sort_weight":99,"slug":100},5,"Comic",60,"comic",{"id":55,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":102,"slug":103},50,"technology",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},7,"Healthcare",40,"healthcare",{"id":110,"doc_module":4,"doc_module_name":25,"category_name":111,"show_sort_weight":112,"slug":113},8,"Research & Report",30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":97,"slug":129},19,"General","general",{"code":4,"msg":82,"data":131},{"doc_id":79,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":55,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":55,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":110,"language":139,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":12,"update_tm":143,"read_time":117,"preview_page_count":33,"preview_urls":144},549758146520,"https://ap-avatar.wpscdn.com/avatar/80002397d8c0411e94?_k=1775819394049821470","([https://creately.com/blog/](https://creately.com/blog/))  \nCreately Blog (/ blog/) 􀄅 diagrams (https://creately.com/blog/category/diagrams/)  \nHello! This is the  blog.  \nCreately helps you draw beautiful diagrams suprisingly fast! Learn More ([https://creately.com/?utm_source=header](https://creately.com/?utm_source=header)  \nbanner&utm_medium=blog&utm_campaign=Increase%20Blog%20Signups) Hide this ()  \nClass Diagram Relationships in UML with Examples  \n1 March 2012  \nMany people consider class diagrams a bit more complicated to build compared with ER diagrams. Most of the time it’s because of the inability to understand the different relationships between class diagram. This article explains how to correctly determine and implement the different class diagram relationships that are applicable in objectoriented modeling. What’s more, you can easily create class diagrams  \n( [https://creately.com/diagram-type/class-diagram?](https://creately.com/diagram-type/class-diagram?)[ ](https://creately.com/diagram-type/class-diagram?)utm_source=classrelationships&utm_medium=blog&utm_campaign=tutorialposts) using our diagramming tool.  \n( [https://d3n817fwly711g.cloudfront.net/blog/wp](https://d3n817fwly711g.cloudfront.net/blog/wp)  \ncontent/uploads/2012/03/Class-Diagram-Relationships.png)  \nRelationships in UML class diagrams  \nWhat are Class Diagrams?  \nClass diagrams are the main building block in object-oriented modeling. They are used to show the different objects in a system, their attributes, their operations and the relationships among them.  \nThe following ¡gure is an example of a simple class:  \n( [https://d3n817fwly711g.cloudfront.net/blog/wp](https://d3n817fwly711g.cloudfront.net/blog/wp)content/uploads/2012/03/Class  \nDiagram.jpeg)  \nSimple class diagram with attributes and  \noperations  \nIn the example, a class called “loan account” is depicted. Classes in class diagrams are represented by boxes that are partitioned into three:  \n1. The top partition contains the name of the class.  \n2. The middle part contains the class’s attributes.  \n3. The bottom partition shows the possible operations that are associated with the class.  \nThe example shows how a class can encapsulate all the relevant data of a particular object in a very systematic and clear way. A class diagram is a collection of classes similar to the one above.  \nRelationships in Class Diagrams  \nClasses are interrelated to each other in speci¡c ways. In particular, relationships in class diagrams include different types of logical connections. The following are such types of logical connections that are possible in UML:  \n Association  \n Directed Association  \n Re¢exive Association  \n Multiplicity  \n Aggregation  \n Composition  \n Inheritance/Generalization  \n Realization  \nAssociation  \n( [https://d3n817fwly711g.cloudfront.net/blog/wp](https://d3n817fwly711g.cloudfront.net/blog/wp)content/uploads/2012/03/AssociationRelationship.jpeg)  \nAssociation  \nis a broad term that encompasses just about any logical connection or relationship between classes. For example, passenger and airline may be linked as above:  \nDirected Association  \n( [https://d3n817fwly711g.cloudfront.net/blog/wp](https://d3n817fwly711g.cloudfront.net/blog/wp)content/uploads/2012/03/Directed  \nAssociation  \nRelationship.jpeg)  \nDirected Association  \nrefers to a directional relationship represented by a line with an arrowhead. The arrowhead depicts a container-contained directional ¢ow.  \nRe¢exive Association  \n( [https://d3n817fwly711g.cloudfront.net/blog/wp-](https://d3n817fwly711g.cloudfront.net/blog/wp-)  \ncontent/uploads/2012/03/Re¢exive  \nAssociation  \nRelationship.jpeg)  \nRe¢exive Association  \nThis occurs when a class may have multiple functions or responsibilities. For example, a staff member working in an airport may be a pilot, aviation engineer, a ticket dispatcher, a guard, or a maintenance crew member. If the maintenance crew member is managed by the aviation engineer there could be a","cbCaig8TkzufB7sp","https://ap.wps.com/l/cbCaig8TkzufB7sp","pdf",260543,"English","# Relationships in UML class diagrams\n## What are Class Diagrams?\n## Relationships in Class Diagrams\n### Association\n### Directed Association\n### Reflexive Association\n### Multiplicity\n### Aggregation\n### Composition","[{\"question\":\"What are UML class diagrams used to represent?\",\"answer\":\"UML class diagrams represent the objects in a system, including their attributes, operations, and relationships among them.\"},{\"question\":\"How does directed association differ from association in UML?\",\"answer\":\"Directed association is a directional relationship shown with a line and arrowhead, indicating a container-contained directional flow.\"},{\"question\":\"What is the key difference between aggregation and composition?\",\"answer\":\"Aggregation emphasizes that the contained class is not strongly dependent on the container’s lifecycle, while composition emphasizes lifecycle dependence such that the contained class is destroyed when the container is destroyed.\"}]","Class Diagram Relationships in UML with Examples - Learn How to Build Correct UML Class Diagram Relationships | PDF",1792963669,[145,149,153,157],{"page_no":22,"url":146,"width":147,"height":148},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/743ea3129e1981712e3b54ba8499869d.webp",983,1272,{"page_no":26,"url":150,"width":151,"height":152},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/a16419284f559ff7ffb285a572d63deb.webp",982,1270,{"page_no":30,"url":154,"width":155,"height":156},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/0ee4f966066fcaa813500d61bafa7991.webp",981,1269,{"page_no":33,"url":158,"width":159,"height":160},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/325d990694c6189b57da84101a91e72a.webp",980,1268,{"list":162,"token":11},[163,170,176,182,188,194,200,206,212,218],{"doc_id":164,"doc_title":165,"file_type":137,"home_preview_img_url":166,"slug":167,"view_count":168,"category_name":29,"create_tm":169},655638,"UML - Unified Modeling Language - Overview of Diagram Types and Class Diagram Notations","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229975286461/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796231879&Signature=NVcqPwrDBr8s71V6k8nkI%2F8v%2BNE%3D","uml-unified-modeling-language-overview-of-diagram-types-and-class-diagram-notations",17,1792962971,{"doc_id":171,"doc_title":172,"file_type":137,"home_preview_img_url":173,"slug":174,"view_count":110,"category_name":29,"create_tm":175},656098,"Tutorial - Class Diagrams and Entity Relationship Diagrams (ERD)","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229975300171/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796231879&Signature=1xzc3maP5RVTnpYbzGxzV0fUakk%3D","tutorial-class-diagrams-and-entity-relationship-diagrams-erd",1792966309,{"doc_id":177,"doc_title":178,"file_type":137,"home_preview_img_url":179,"slug":180,"view_count":55,"category_name":29,"create_tm":181},656101,"Class Diagrams and Entity Relationship Diagrams (ERD) - Create UML and ERD Structure Models","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229975300346/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796231879&Signature=vEx2AohLo6GbD3o5%2B2E5PYmqqNI%3D","class-diagrams-and-entity-relationship-diagrams-erd-create-uml-and-erd-structure-models",1792966358,{"doc_id":183,"doc_title":184,"file_type":137,"home_preview_img_url":185,"slug":186,"view_count":30,"category_name":29,"create_tm":187},678088,"A Tool for Efficiently Reverse Engineering Accurate UML Class Diagrams","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229994558631/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796231879&Signature=pJCKVjJZ%2BG13b2QPv7qQFgBrTqA%3D","a-tool-for-efficiently-reverse-engineering-accurate-uml-class-diagrams",1793783997,{"doc_id":189,"doc_title":190,"file_type":137,"home_preview_img_url":191,"slug":192,"view_count":115,"category_name":29,"create_tm":193},655925,"UML Diagram Key - Basics","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229975294431/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796231879&Signature=%2FmWxzI4fViIpPwdarI%2Fvyqo70Uw%3D","uml-diagram-key-basics",1792964949,{"doc_id":195,"doc_title":196,"file_type":137,"home_preview_img_url":197,"slug":198,"view_count":115,"category_name":29,"create_tm":199},655771,"UML - Unified Modeling Language - Design and UML Diagrams","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229975289134/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796231879&Signature=xxw1bmxbSqJ9kQRV%2BOmuLizDJCU%3D","uml-unified-modeling-language-design-and-uml-diagrams",1792963662,{"doc_id":201,"doc_title":202,"file_type":137,"home_preview_img_url":203,"slug":204,"view_count":110,"category_name":29,"create_tm":205},655575,"UML Tutorial - Part 1 - Class Diagrams","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229975285546/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796231879&Signature=lA%2FjOF%2FAoyY8wKWmawcYIYl%2FFAI%3D","uml-tutorial-part-1-class-diagrams",1792962707,{"doc_id":207,"doc_title":208,"file_type":137,"home_preview_img_url":209,"slug":210,"view_count":123,"category_name":29,"create_tm":211},655580,"Class Diagrams: The Essentials","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229975285558/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796231879&Signature=ive7MOy%2FMKRNZOaIvgkMr4kzsU8%3D","class-diagrams-the-essentials",1792962720,{"doc_id":213,"doc_title":214,"file_type":137,"home_preview_img_url":215,"slug":216,"view_count":105,"category_name":29,"create_tm":217},655766,"CPS122 Lecture - Class Diagrams in UML","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229975289054/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796231879&Signature=6jW9wHJO%2B5zWwiml0Q5UWS5daj8%3D","cps122-lecture-class-diagrams-in-uml",1792963653,{"doc_id":219,"doc_title":220,"file_type":137,"home_preview_img_url":221,"slug":222,"view_count":223,"category_name":29,"create_tm":224},655581,"Class Diagrams - Lecture 1 - Class Diagram with UML - Learning objectives, associations, generalization, and quality checklist","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229975285561/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796231879&Signature=dAsSyDjDHVYQHize4nweSw0O5RI%3D","class-diagrams-lecture-1-class-diagram-with-uml-learning-objectives-associations-generalization-and-quality-checklist",11,1792962722]