UML diagram Complex

Source: Internet
Author: User

UML-united modeling language, unified modeling language-is an object-oriented visual modeling language. UML uses a set of visualized graphical symbols (such as class diagrams) as the modeling language. These symbols can be used to visually describe all aspects of the system. UML describes a model by establishing various relationships between graphs (such as the relationship between classes.

There are 5 types (9 types) of diagrams in UML, includingUse case diagram, static diagram (Class Diagram and object Diagram), Behavior diagram (Status chart and activity diagram), InterAction diagram (Timeline chart and collaboration Diagram), Implementation diagram (Component diagram and deployment Diagram). The class diagram is the most important, and the use case diagram and time sequence diagram also need to be mastered. UML
There are four main types of relationships in the project: Association, dependency, generalization, and realization ).

1. use case diagram

First, let's take a look at the use case diagram, also known as the user model diagram, which is the first step from software requirement analysis to final implementation, it describes system functions from the user's perspective. And the executors of each function. The use case diagram contains three basic components:Actors, use cases, and relationships.

1.1 participants ):The person or other system that interacts with the system, that is, the person or thing that uses the system. In UML, participants are represented by human icons.
1.2 use case ):Represents a complete function of the system. It is represented by an elliptic in UML.
1.3 relationship:Define the relationship between use cases ------ generalized relationship, including the relationship and extended relationship.
1.31 generalized relationship: Represents different technical implementations of the same business purpose (parent case) (each sub-case ). in UML, the use case is generalized by a triangular arrow pointing from the child case to the parent case. A shopping website provides different payment methods for users. A use case can contain the behaviors of other use cases and take the behaviors of the use cases as part of their own behaviors.

1.32 inclusion relationship:Add "<include>" to the link contained in UML with the dotted arrow to point to the included use case.

1.33 extended relationships:If another function is occasionally executed when a function is completed, the extension relationship is used. in UML, add <extend> with the dotted arrow to the extended use case.

2. Class Diagram

Next we will look at the class diagram, which is the most common graph in object-oriented system modeling and the basis for defining other graphs. A class chart is used to display the classes, interfaces, and relationships in the system. It describes the static structure of the system. A class chart contains classes, interfaces, and relationships. The relationships include associations, General relationships, dependencies, and implementation relationships. Annotations and constraints can also be included in the class diagram.

2.1 Categories: Is the main component of a class chart. It consists of class names, attributes, and methods. In UML, classes are represented by rectangles. The top part stores the class name, the middle part stores the class attributes, the type and value of the attributes, and the method for storing classes in the bottom part, method parameters and return types. In UML, you can choose to hide the hidden property part or method part or both based on the actual situation. In UML, the common types are represented by "+", private types are represented by "-", and protection types are represented. UML Tool developers can use their own defined symbols to express different visibility.

2.2 Relationship
2.21 generalized relationship
: In UML, a solid-line hollow arrow (Child class pointing to parent class) is used to represent the inheritance relationship between classes and interfaces. A generalized link is also called a "is a kind of" link. Inheritance is also divided into single-inheritance and multi-inheritance. A single inheritance class inherits from one parent class, while a multi-inheritance class inherits from multiple parent classes.

2.22 implementation relationship: In UML, a dotted-line hollow arrow (Child class pointing to parent class) is used to represent the implementation relationship between classes and interfaces.

2.23 dependency: For two relatively independent systems, when one system is responsible for constructing instances of the other system or relying on services of the other system, the two systems are dependent on each other. The dependency is expressed by the dotted arrow.

2.24 Association: For two relatively independent systems, when the instance of one system has a fixed ing relationship with some specific instances of the other system, the two systems are associated. The associations are represented by the solid arrow. These two are very confusing, so be sure to differentiate them. When a class is at one end of the Association, the class plays a specific role in the relationship. specifically, a role is the responsibility of one class in the association relationship for another class. A role name is a noun or name phrase. Multiple associations refer to the number of objects that can participate in the association,
Multiple values can be used to express a value range, a specific value, and an infinite range.

2.241 aggregation relationship:Is a special association. it indicates that the relationship between classes is the relationship between the whole and the part. in short, a class in an Association describes a large thing, which is composed of a small thing. The aggregation Association describes the relationship between "has a", that is, the whole object has some objects. The whole and the part are connected by a hollow diamond arrow, and the arrow points to the whole.

2.242 composite relationship:Is a stronger form of aggregation. In a composite relationship, the entire part has its lifecycle. Therefore, when the whole part is deleted, it must be deleted. in addition, multiple parts cannot share the same part at the same time. In an aggregation relationship, the whole part does not have the life cycle of the part, so the part will not be deleted when the whole part is deleted. In addition, multiple parts can share the same part. The constructor in UML is represented by solid diamond solid line.

Unidirectional Association:The association that can be navigated only in one direction is called unidirectional Association. It is represented by a solid line of a unidirectional arrow.

Bidirectional Association:It is indicated by an arrow direction, and the association that can be navigated in both directions is called bidirectional Association, which is expressed by a solid line without an arrow.

3. object graph

An object chart is very similar to a class chart, but it only describes the static structure of a system at a certain time point, and a class chart describes all possible situations. Including objects, connections, and packages.

4. Timeline chart

The following is a sequence diagram. A Sequence diagram is also called a sequence diagram or sequence diagram. It is used to describe the time sequence of passing messages between objects, that is, the behavior sequence in the use case. When executing a use case, each message in the sequence diagram corresponds to a class operation or a conversion trigger event. In UML, a sequence diagram is a two-dimensional relationship diagram. The vertical axis is the timeline, and the time is extended vertically. the horizontal axis represents each independent object in the collaboration. When an object exists, the lifeline is represented by a dotted line, and the message is represented by an arrow from the lifeline of an object to the lifeline of another object. The arrows are arranged up and down in chronological order in the graph. The following concepts in the sequence diagram are very important:
4.1 objects:Objects in a sequence chart are represented by rectangles with underlines. placing an object at the top of the sequence graph indicates that the object already exists at the beginning of interaction. if the object is not on the top, it indicates that the object was created during interaction.
4.2 lifeline:A lifeline is a vertical dotted line that indicates the existence of objects in a sequence chart within a lifecycle. the center of each object carries a lifeline.
4.3 message:Single-channel communication between two objects. Direct from the sender to the receiver. return messages are rarely used in the time sequence diagram.

4.4 activation/passivation:A time sequence diagram can describe the activation and passivation of an object. activation indicates that the object is occupied and a task has been completed. passivation indicates that the object is idle and waiting for a message. in UML, when an object is activated, the lifeline of the object is extended to a rectangle. A rectangle is called a plan bar or a control period. the object is activated at the top of the activation bar. the object is passive after completing its own work.
4.5 creation and destruction of objects:In a sequence chart, the default position of an object is at the top of the graph. this indicates that the object already exists before the interaction starts. if the object is created during the interaction process, put the object in the middle. if you want to cancel an object, place the "X" symbol at its lifeline termination point.

5. Collaboration Diagram

It is also called a collaboration chart. It can be seen as the intersection of a class chart and a sequence chart, a collaboration chart Modeling object or role, and their communication methods. The time sequence diagram emphasizes the time sequence of object interaction, while the collaboration diagram emphasizes the interaction between objects.

6. activity diagram

Next we will look at the activity diagram. In UML, the activity diagram is essentially a flowchart, which describes the activities, points, and branches of the system. The activity diagram shows where functions exist in the system, and how these functions and the functions of other components in the system can meet the business needs of the use case diagram modeling. There are also the following basic concepts:
6.1 action status: Atomic, non-disruptive action, and changes to another action after the action is completed. In UML, the action State is represented by a rounded rectangle, and the Action indicated by the action state is written inside the rounded rectangle.
6.2 Branch:It is common in software systems. It is generally used to indicate the conditional behavior of the object class. It uses a Boolean expression to determine the flow of the action. Conditional behavior is expressed by branch and merge. in the activity diagram, the branches are represented by a small hollow diamond. the branch includes one inbound conversion and two conditional outbound conversions. The output conversion conditions should be mutually exclusive and ensure that only one outbound conversion can be triggered. The merge operation includes two conditional input transformations and one output conversion.
6.3 forks and Confluence:A fork is used to describe concurrent threads. Each fork can have one input conversion and two or more output conversions. each conversion can be an independent control flow. confluence means that two or more concurrent control flows are synchronized. When all the control flows reach the confluence, the control can continue. each confluence can have two or more input transformations and one output conversion. in UML, a rough straight line is used to represent a branch and sink.
6.4 lanes:Is a concept of comparative image. the swimming pool divides activities in the activity diagram into several groups and assigns each group to the business organization responsible for this group of activities. the swimming track distinguishes the objects in charge of activities and clearly indicates which activities are performed by which objects. each activity explicitly belongs to a swimming pool. In the activity diagram, the swimming track is drawn by vertical solid lines, and the area separated by vertical lines is the swimming track.

7. Status chart

A status chart can capture the lifecycle of objects, subsystems, and systems. It is used to describe all possible states of a specific object and transfer between States caused by various events. A status chart should be connected to all classes with clear and marked states and complex behaviors. It can determine the behavior of the class and how the behavior changes according to the current status, it can also show which events will change the object state of the class.

8. Component Diagram

A component diagram is also called a component diagram. It describes the main functions of a system from the perspective of software architecture, such as subsystems, classes, packages, and components. The most important function of building a graph is reuse. In the component diagram, a component is a physical and replaceable part of the system that follows the same set of interfaces and provides implementation. It defines a good interface Implementation Unit, it can be a file, product, executable file, script, etc.

9. Deployment Diagram

Physical deployment of modeling systems. For example, computers and devices, and how they are connected. The deployment diagram uses developers, system integrators, and testers.

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.