UML summary-the role of six relationships and nine diagrams

I have studied UML, and I should have a general understanding of UML. The picture below is a mind map I drew.

It can be seen from the figure that UML can be roughly divided into views, things, relationships and its 9 kinds of diagrams.

view

In logical view: logical view is usually represented by class diagram, object diagram and package diagram, component diagram is usually represented by component diagram, concurrency diagram is usually represented by state diagram, activity diagram, sequence diagram, and collaboration diagram, configuration diagram is usually represented by configuration diagram Representation, a use case diagram is usually represented by a use case diagram.

Structural things are also divided into classes, interfaces, use cases, collaborations, activity classes, components and nodes

Class: A class is a collection of a set of objects with the same properties, the same methods, the same semantics and the same relationships. A class can implement one or more interfaces. In UML diagrams, classes are represented by rectangles that include class names, attributes, and methods.

Interface: An interface refers to a set of operations provided by a class or component that can complete a specific function. That is: an interface describes the external and visible actions of a class or component, and usually a class implements one or more interfaces.

Use case: A use case defines a set of operations of the system to produce observable results for a specific user.

Collaboration: Collaboration defines interactive operations, which means that some roles and other elements work together to provide some cooperative actions. A given class may be part of several collaborations, which represent the realization of the patterns that make up the system. In UML, collaboration is usually represented by a dotted ellipse.

Active class: refers to a class whose class object has one or more threads or processes. An activity class is similar to a class, except that the behavior of the element represented by its object exists at the same time as other elements. The representation method of the activity class in UML is similar to the representation method of the ordinary class, and a rectangle is also used, except that the outermost frame is thick.

Component: The component is physically replaceable, and realizes one or more system elements that are painful.

Node: A node is a physical element that exists at runtime and represents a computable resource. In UML, a node is represented by a cube.

relationship

Association relationship : An association relationship is a structured relationship, which refers to the relationship between one object and another . It is a kind of ownership relationship, which makes one class know the attributes and methods of another class, such as: teacher and student, husband and wife . The association relationship can have a direction, which means that the association is used in a certain direction. An association that exists in only one direction is called a one-way association, and an association that exists in both directions in the country is called a two-way association. The association relationship is represented by a solid line . Two-way associations can have two or no arrows, and one-way associations have one arrow.

There is a two-way relationship between teachers and students. Teachers can have multiple students and students can also have multiple teachers, but there is a one-way relationship between students and courses. A student can have multiple courses, and the course does not have students.

Aggregation : It is a special case of association. Aggregation represents the relationship between the whole and the part when the relationship between the class and the class . Aggregation is the relationship between the whole and the part, and the part can exist separately from the whole. If the object of the storage and transportation part can participate in the formation of multiple objects in the whole at the same time, the aggregation is called a shared aggregation. In IUML, the aggregation relationship is represented by a straight line with a small hollow diamond. The diamond end connects the model elements representing the whole thing, and the other end connects the model elements of some things.

For example: a judge can participate in multiple competitions, which means that the singing contest is composed of judges and other objects

Combination relationship : A tighter coupling relationship on top of the aggregation relationship when the relationship is combined, describing the relationship between the part and the whole of the elements . Some classes need the whole class to exist. When the whole class is destroyed, some classes will be destroyed at the same time. The combination relationship is represented by a straight line with a solid small diamond at one end , the diamond end is connected to the model element representing the whole thing, and the other end is connected to the model element representing the part of the thing.

Dependency : The dependency relationship describes the semantic relationship between two model elements (classes, use cases) and is a usage relationship . One of the model elements is independent, and the other model element is not independent. It depends on the independent model element. If the independent model element changes, it will affect the elements that depend on it. The arrow points to the designated user.

Generalization : It is an inheritance relationship that represents the general and special relationship, and specifies how the subclass specializes all the characteristics and behaviors of the parent class. Generalization can be divided into ordinary generalization and restricted generalization. Ordinary generalization does not add constraints to generalization. The general generalization relationship is represented by a solid line with a hollow arrow, which points to the parent class . Restricted generalization can add constraints to the generalization relationship, indicating the method of use or expansion of the generalization relationship.

Implementation : It is a relationship between a class and an interface , which means that the class is the realization of all the characteristics and behaviors of the interface. In UML, it is represented by a dashed line with a triangle, and the arrow points to the interface.

The order of the strengths and weaknesses of various relationships: generalization = realization> combination> aggregation> association> dependency

The following figure describes the various relationships:

In addition: use case diagrams are divided into use case diagrams; static diagrams are divided into: class diagrams, object diagrams, package diagrams; interaction diagrams: sequence diagrams, collaboration diagrams

In the requirements phase: use case diagrams to describe requirements

Analysis phase: Describe static structure with class diagram

Design stage: Design the interface of the class with class diagram and package diagram

Implementation stage: implement the class in an object-oriented language

Integration and delivery stage: component diagram, package diagram, deployment diagram

Test phase: class diagrams and class specifications for unit testing, class diagrams, package diagrams, component diagrams, and cooperation diagrams for integration testing phase, and use case diagrams to test system functions in system testing phase.

Use case diagram : Describe the role and the connection relationship between the role and the use case. Explain who will use the system and what they can do with it

Class diagram : A static view that describes the static structure of the system and the relationship between various classes.

Object diagram : Describe the static structure of the system at a certain moment. It is an instance of the class diagram, and the object diagram is multiple object instances of the Xi'an class, not an instance of the class.

Activity diagram : Describe the activities required by the use case and the constraint relationships between the activities.

State diagram : describes all possible states of objects of the class and the transition conditions of the state when the event occurs.

Sequence diagram : describes the interaction between system elements in the order of events, and is used to show how your participants interact with the objects of the system in a series of sequential steps.

Collaboration diagram : Shows the activity cooperation status between objects. It can be seen as the intersection of time class diagram and sequence diagram, describing the interactions between system elements and their relationships in time and space order.

Component diagram (component diagram): Describe the physical structure of code components and the direct dependencies of various constructions. The organization of the elements of the realization system.

Deployment diagram : used to model the physical deployment of the system. For example, computers and equipment, and how they are connected, the deployment users are developers. System integrators and testers.

 

The above is a summary of UML, if any deficiencies are pointed out, please correct me!

https://blog.csdn.net/dragonpeng2008/article/details/6836448

Guess you like

Origin blog.csdn.net/weixin_45309155/article/details/107119435