The core---class diagram of UML diagram

Source: Internet
Author: User

UML consists of nine diagrams, in which the core is the only---class diagram.

Here is my summary of the Class Diagram section in UML.

Class diagram is a static structure that shows the model, especially the classes that exist in the model, the internal structure of the classes, and their relationships to other classes. When learning the relationship between classes and classes, it is still necessary to differentiate between aggregation and composition, although they all represent the relationship between the whole and the part, but they are still different.

Aggregation (aggregation) Relationship: A special case of association relation, which is a strong association relation. Aggregation is the relationship between the whole and the individual, that is, the relationship between the whole and the has-a, which can have their own life cycle, some can belong to a plurality of whole objects, can also be shared for multiple whole objects, such as computer and CPU, the relationship between the company and the staff, etc., at the code level, is consistent with the correlation, and can only be differentiated from the semantic level;

The aggregation relationship is also implemented using instance variables. There is no association or aggregation from the Java syntax.

Combinatorial (composition) relationship (composition): Also a special case of association, he embodies a kind of contains-a relationship, which is stronger than aggregation, also known as strong aggregation; he also embodies the relationship between the whole and the parts, but at this time the whole and part are not divided, The end of the whole life cycle means that part of the life cycle ends, like you and your brain; Synthetic relationships cannot be shared. 。 Performance at the code level, and the association relationship is consistent, only from the semantic level to differentiate.
"Parts" in a combination cannot be separated from the "whole".


In the UML learning of the class diagram of the understanding and learning only stay in the text level, such as the end of the video, there will be a deeper understanding of the experience.

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.