Read UML class diagrams

Source: Internet
Author: User
Tags dashed line

The various elements of UML are not mentioned here, I just want to talk about the relationship between classes in the class diagram, can understand the class diagram of the lines between the classes, arrows represent what meaning, it is enough to deal with daily work and communication, at the same time, we should be able to express the meaning of the class diagram and the final code corresponding; Look at the design pattern structure of the later chapters there is no problem;

All graphics in this chapter use Enterprise Architect 9.2来, and all examples are described in the root directory of Design_patterns. Eap

Starting from an example

Consider the following class diagram, where the relationship between classes is what we need to focus on:

    • The class diagram structure of the car is <<abstract>>, which means that the car is an abstract class;
    • It has two inheritance classes: cars and bicycles; the relationship between them is to implement the relationship, using a dashed line with a hollow arrow;
    • The car is also an inheritance relationship between the SUV, the relationship between them is a generalization relationship, using a solid line with a hollow arrow representation;
    • Between the car and the engine is a combination of relations, using a solid line with the arrows to express;
    • Between the student and the class is the aggregation relation, uses the solid line with the hollow arrow to represent;
    • The relationship between the student and the ID card is related, and a solid line is used to express it;
    • The student needs to go to school to use the bicycle, is a kind of dependence with the bicycle, uses the dotted line with the arrow to indicate;

Reference: http://design-patterns.readthedocs.io/zh_CN/latest/read_uml.html

Read UML class diagrams

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.