UML Unified Modeling Language Learning Record

UML introduce yourself to Baidu, there is nothing to copy, it is to show the code in the project with icons. Japanese companies do not use UML, but directly specify the relevant drawing on Excel.

The software used is PowerDesigner 16

composite structure(类图)

Class diagram: Describe the static structure of the classes in the system.

Description:

It is a java class. Class is the name of the java class. It establishes a symbolic link with different java classes or enumeration classes or interfaces. This kind of overall graphics is also called a structure diagram.

You can directly double-click to open the icon

 The perview project can be directly edited and is not recommended.

The general project can set common attributes

name: java class name (can be Chinese, 254 characters)

code: alias (not Chinese, must be English, 254 characters, generally UID)

comment: Remarks (detailed function introduction)

extends: inheritance

Stereotype: a subclass derived from an existing package

visibility: access modifier

cardinality: cardinality (number of sets)

type: file type (class: Java bytecode, generic: generic)

Others are not important, you can click the help button to directly view the development document

The Domain field indicates the value range of the attribute. For example, a 10-character address field can be created 

D:Displayed is displayed, all checked by default

Generalization

Inheritance, the arrow points to the parent class, the solid line points to the child class, eg:

public class Animal {
}

public class Tigress extends Animal  {
}

Detailed explanation:  Tigress belongs to the animal category.

Realization

Implementation interface, the arrow points to the implementation interface, and the dotted line points to the implementation class

public interface Jump {
}
public class Tiger implements Jump {
}

Detailed explanation: The  tigress will have a number in the zoo, as well as her preferences, as well as its basic life, eating and releasing and various behaviors.

 

Dependency

Call the common method and call the necessary methods of other classes. For example, the animal needs to eat, and the action of eating is placed in a Java class. At this time, you need to call the method of the Java class to complete the acquisition of food, eg:

public class Animal{

    public static void main(String args[]){
        /**  动物需要食物 */
        Food f=new Food();
        f.eat();
    }

}

public class Food{

    public void eat(){
    
    }

}

Detailed explanation: Animals need food. If there is no food, they will starve to death. If you catch a deer, you can have a full meal. That is to say, different foods caught by tigers have different body shapes and different tastes. The Food category is affected, and the Aniaml category will also be affected. 

Association (Association)

Declare or call multiple objects, inject a bean to use, the arrow points to the object that needs to be used, the solid line points to the introduced object, the number above the solid line represents the result set that will be obtained, and the number below represents the set of conditions that may be required. eg:

public class YoungTiger{

    /** 5头年轻老虎有时有一到两个饲养员 */
    private List<Zookeeper> zookeepers;

}

public class Zookeeper{
}

Detailed explanation:  There are five young tigers in the zoo, and they have zero to two keepers.

Composition

Similar to association, but the combination emphasizes more non-lost classes. Querying the database is a basic function and cannot be lost, eg:

public class Tigress{

    /** 母老虎有四条腿 */
    private List<Leg> legs:

}

public class Leg{

}

Detailed explanation:  a tiger has four legs

Aggregation

Same as above, but the relationship is not strong, it is optional

public class YoungTiger{


}

public class Zoo{

    private List<YoungTiger> yt;

}

Link the Require  (Demand connection)

 Similar functions, there is a general interface, and two different classes are implemented at the same time, eg:

Detailed explanation: Promotions include reduction promotions and discount promotions

Inner Link

Inner class call

public class Class7 {

   public class Class8 {
   }

}

example:

Detailed explanation: Comprehensive explanation of the above

Object diagram

Instance Link (association)

There is an association between objects

Component Diagram

example:

Detailed explanation : The administrator user accesses myorder through port 8080, the order sends the request to the server port 8090, the server gets the order of the corresponding user, and returns to the administrator the user's own order information.

Deployment Diagram

example:

 

Detailed explanation: OW+ framework overall structure 

Activity Diagram-Activity Diagram

example:

Detailed explanation: The specific business realization of the business. 

Communication diagram/assistance diagram-communication diagram

example:

Sequence diagram-sequence diagram

 example:

Use case diagram

example:

 

Statechart diagram

Guess you like

Origin blog.csdn.net/qq_41520636/article/details/112596806