Association, aggregation, and combination in UML class diagrams

Source: Internet
Author: User
Keywords: UML Analyze the definitions and relationships of association, aggregation, and combination in a UML class diagram.@ Author: ZJ 06-11-27http: // zhangjunhd.blog.51cto.com/ 1. Association)Most of the associations between classes are used to indicate that the variable instance holds a reference to other objects. Phone has a reference to the button. 2. Aggregation)Aggregation is a special form of association, which means a whole/part relationship. A whole cannot be a part of itself. Therefore, an instance cannot form an aggregation loop. A single object cannot be its own aggregation, two objects cannot be aggregated, and three objects cannot form an aggregation ring. It is an illegal aggregation cycle between instances: 3. Composition)Combination is a special form of aggregation. UML defines a combination: ① like aggregation, the instance cannot have loops. ② An owned instance cannot have two owners at the same time. ③ The owner is responsible for managing the lifecycle of the combined object. If the owner is destroyed, the owner must also be destroyed together. If the owner is copied, the owner must also be copied together. Based on this, you can use a combination to describe deep copy. Invalid combination: 4. References(1) Robert Martin, UML for Java programmers, 2004

This article is from the "sub-blog", please be sure to keep this source http://zhangjunhd.blog.51cto.com/113473/36050

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.