[Introduction to the Nine Diagrams of UML in Software Design]

Use Case Diagram: Describes system functions from the user's point of view and identifies the operators of each function.

 

Static diagrams: including class diagrams and object diagrams. The class diagram describes the static structure of the classes in the system. It not only defines the classes in the system, but also represents the relationship between classes, such as association, dependency, aggregation, etc., and also includes the attributes and operations of the class. The class diagram describes a static relationship. It is valid for the entire life cycle of the system. Object diagrams are instances of class diagrams and use almost the exact same identification as class diagrams. An object diagram is an instance of a class diagram. Since objects have a life cycle, the object graph can only exist for a certain period of time in the system.

 

Behavior diagram: Describes the dynamic model of the system and the interaction between constituent objects, including state diagrams and activity diagrams. The state diagram describes all possible states of the object of the class and the transition conditions of the state when the event occurs. The state diagram is a supplement to the class diagram. The activity diagram describes the activities to be performed to meet the requirements of the use case and the constraints between the activities, which is conducive to identification and implementation. Activity.



 

Interaction diagram : Describes the interaction between objects, including sequence diagrams and collaboration diagrams. The sequence diagram shows the dynamic cooperation relationship between objects. It emphasizes the order in which messages are sent between the objects and shows the interaction between the objects. The collaboration diagram describes the cooperation relationship between objects. partnership. In addition to showing the exchange of information, collaboration diagrams also show objects and the relationships between them. If time and order are emphasized, use sequence diagrams; if superior and subordinate relationships are emphasized, choose collaboration diagrams.

 

Implementation diagram: including component diagram and deployment diagram. The component diagram describes the physical structure of the code components and the dependencies between the components. The component diagram helps to analyze and understand the degree of mutual influence between the components; the deployment diagram defines the physical architecture of the software and hardware in the system.

 

When designing a system using UML,

The first step is to describe the requirements;

The second step is to establish a static model of the system according to the requirements to construct the structure of the system;

The third step is to describe the behavior of the system.

The models established in the first and second steps are all static, including 5 kinds of graphs including use case diagram, class diagram, object diagram, component diagram and deployment diagram, which are the static modeling mechanism of the standard modeling language UML. . The model established in the third step can either be executed, or represents the time sequence state or interaction relationship during execution. It includes four kinds of graphs, such as state diagram, activity diagram, sequence diagram and collaboration diagram. It is the dynamic modeling mechanism of the standard modeling language UML.

 

 

Static diagrams: use case diagrams, class diagrams, object diagrams, component diagrams and deployment diagrams; 2) Dynamic diagrams: sequence diagrams, collaboration diagrams and activity diagrams.

 

use case diagram

 

class diagram sequence diagram

 



 

 

 

 

One: Each of these nine model diagrams has its own emphasis.

 

1: Use case diagrams focus on describing user needs,

 

2: The class diagram focuses on describing the specific implementation of the system;

 

Two: the descriptions are not the same,

 

1: The class diagram describes the structure of the system,

 

2: The sequence diagram describes the behavior of the system;

 

Three: the level of abstraction is also different,

 

1: The component diagram describes the module structure of the system, with a high level of abstraction.

 

2: The class diagram is to describe the structure of the specific module, the abstraction level is general,

 

3: The object graph describes the specific module implementation, and the abstraction level is lower.

 

In some literature books, these nine model diagrams are divided into three categories:

 

Structural classification, dynamic behavior and model management:

 

1: Structural classification includes use case diagram, class diagram, object diagram, component diagram and deployment diagram,

 

2: Dynamic behavior includes state diagrams, activity diagrams, sequence diagrams and collaboration diagrams,

 

3: Model management includes class diagrams.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326276924&siteId=291194637