UML class diagrams: simple learning of various objects and relational UML representations

Source: Internet
Author: User

 

The UML class diagram above the big talk design pattern:

 

Class UML Representation

The rectangular box of an animal indicates a class.

A class chart is divided into three layers. The first layer displays the class name. If it is an abstract class, it is represented in italic; the second layer shows the class characteristics, usually the class fields and attributes; the third-layer display operation is usually a method or action.

The preceding "+" indicates public, "-" indicates private, and "#" indicates protected.

UML representation of interfaces

The main difference between the UML representation of an interface and a class diagram is that there is <interface> display at the top. The first line is the interface name, and the second line is the interface method.

The interface also has another representation method, commonly known as lollipop notation, such. The name of the interface beside the circle.

Inherited UML Representation

Inheritance relationshipHollow triangle + solid line.

UML representation of Implemented interfaces

For example, the aggregsor and student classes implement the person interface,The implementation interface is represented by a hollow triangle + dotted line in UML.

The Association is represented by UML.

The associations are represented by the solid arrow.

UML representation of an aggregate relationship

Aggregation indicates a weak "ownership" relationship. It indicates that object A can contain object B, but object B is not part of object. The aggregation relationship is represented by a hollow diamond + solid arrow.

There are two numbers on both sides of the line, which is called the base number. It indicates that the class at this end can have several instances.The car has 1 engine and 4 tires.

UML for Link Synthesis

The compositing relationship is a strong relationship of ownership, reflecting the strict relationship between the entire part and the entire life cycle. The compositing relationship is represented by a solid diamond + solid arrow.

 

Dependency UML diagram

Animals depend on water and oxygen, and they are dependent on each other. Use the dotted arrow to show!

 

References: big talk Design Model

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.