"Dahua Design Mode" Memo Notes-UML Class diagram diagram __ design mode-java

Source: Internet
Author: User
Tags dashed line
Classes (Class)

A rectangular box is used in UML to represent a class. Class diagram is divided into three layers, the first layer displays the class name, and if it is an abstract class, it is shown in italics. The second layer is the attributes of the class, usually the fields and properties. The third layer is the operation of the class, usually the method or the behavior. Note the preceding symbol, ' + ' means public, '-' means private, ' # ' means protect.
interface (interface)

The main difference between the interface diagram and the class diagram is that the top has <> display. The first layer is the interface name, and the second layer is the interface method.

Interface there is another way of representation, commonly known as lollipop notation, is Donald Duck class to achieve the ' speaker ' interface.
inherited

The inheritance relationship is represented by a hollow triangle + solid line.
Implement

The implementation interface is represented by a hollow triangle + dashed line.
Associated

When a class "knows" another class, it can be associated with. The association relation is represented by a solid line arrow.
Aggregation

Aggregation represents a weak "owning" relationship in which a object can contain a B object, but a B object is not part of a object. The aggregation relationship is represented by a hollow diamond + solid arrow.
synthesized

Synthesis is a strong "own" relationship, which embodies a strict part-and-whole relationship, part of the same life cycle as the whole. A composite relationship is represented by a solid diamond + solid arrow. In addition, you will notice that there are also numbers "1" and "2" in the line at both ends of the composite relationship, which is called cardinality. Shows that there are several examples of classes at this end, and it is clear that a bird should have two wings. If a class can have countless instances, it is represented by "n". Association, aggregation relationships can also have cardinality.
reliance on

If the initialization of class member objects needs to depend on other objects, they are dependencies. Use a dashed arrow to indicate.

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.