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.