Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the commonly used UML diagrams

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Most people do not understand the knowledge points of this "commonly used UML diagram" article, so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "commonly used UML diagram" article.

1. Use case diagram

The use case diagram describes a functional unit provided by the system. The main purpose of use case diagrams is to help the development team understand the functional requirements of the system in a visual way, including "actors" (that is, other entities that interact with the system) based on basic processes, as well as the relationships between use cases within the system. Use case diagrams generally represent the organization of use cases-either all use cases for the entire system, or a set of use cases that complete functions (for example, all security management related use cases). To display a use case on a use case diagram, draw an ellipse and place the name of the use case in the center of the ellipse or in the middle below the ellipse. To draw a character (representing a system user) on a use case diagram, draw a humanoid symbol. The relationship between roles and use cases is described by simple line segments

two。 Class diagram

Class diagrams commonly used in UML diagrams show how different entities (people, things, and data) relate to each other; in other words, it shows the static structure of the system. Class diagrams can be used to represent logical classes, which are usually the types of things that business people talk about-rock bands, CD, radio dramas, or loans, home mortgages, car loans, and interest rates. Class diagrams can also be used to represent implementation classes, which are entities that programmers deal with. The implementation class diagram may show some of the same classes as the logical class diagram. However, the implementation class diagram does not use the same attributes to describe it, as it is likely to have references to things such as Vector and HashMap.

The class is described in a rectangle with three parts on the class diagram, the top part shows the name of the class, the middle part contains the properties of the class, and the bottom part contains the operation (or "method") of the class.

3. Sequence diagram

Sequence diagrams in common UML diagrams show the detailed flow of a specific use case (or part of a use case). It is almost self-describing and shows the call relationships between different objects in the process, as well as different calls to different objects in great detail.

A sequence diagram has two dimensions: the vertical dimension displays the sequence of messages / calls in the chronological order in which they occur, and the horizontal dimension shows the object instance to which the message is sent.

The drawing of sequence diagrams is very simple. Across the top of the diagram, each box (see figure 4) represents an instance (object) of each class. In the box, the class instance name and the class name are separated by spaces / colons / spaces, for example, myReportGenerator:ReportGenerator. If a class instance sends a message to another class instance, draw a connection with an open arrow pointing to the receiving class instance, and place the name of the message / method on the connection. For some particularly important messages, you can draw a dashed line with an open arrow pointing to the instance of the originating class, marking the return value on the dotted line. As far as I'm concerned, I always like to draw dotted lines that include return values, and this extra information can make sequence diagrams easier to read.

4. State diagram

The state diagram represents the different states of a class and the state transition information of the class. One might argue that every class has a state, but not every class should have a state diagram. State diagrams are described only for classes with "interested" states (that is, classes with three or more potential states during system activity).

The symbolic set of state diagrams consists of five basic elements: the initial starting point, which is drawn using solid circles; the transition between states, which is drawn using line segments with open arrows; states, which are drawn using rounded rectangles; decision points, which are drawn using hollow circles; and one or more termination points, which are drawn using circles with solid circles inside. To draw a state diagram, first draw the starting point and a transition line segment that points to the initial state of the class. The states themselves can be drawn anywhere on the diagram, and then simply connect them using state transition lines.

Reading sequence diagrams is also very easy. Start with the "driver" class instance of the startup sequence in the upper-left corner, and then read down each message. Remember: although the example sequence diagram shown in figure 4 shows the return message for each message sent, this is only optional.

5. Activity diagram

An activity diagram represents the flow of process control between two or more classes of objects when an activity is processed. Activity diagrams in common UML diagrams can be used to model higher-level business processes at the business unit level, or to model low-level internal class operations. In my experience, activity diagrams are best used to model higher-level processes, such as how the company currently operates the business, or how the business operates. This is because activity diagrams are "less technical" in presentation than sequence diagrams, but business-savvy people tend to understand them more quickly.

The symbol set of the activity diagram is similar to the symbol set used in the state diagram. Like a state diagram, an activity diagram starts with a solid circle connected to the initial activity. The activity is represented by a rounded rectangle in which the name of the activity is included. Activities can be connected to other activities by converting segments, or to decision points, which are connected to different activities protected by the conditions of the decision point. The activity that ends the process is connected to an end point (as in the state diagram). As an option, activities can be grouped into swimming lanes (swimlane), which are used to represent objects that actually perform the activity.

6. Component diagram

The component diagram provides a physical view of the system. Its purpose is to show the dependencies of software in the system on other software components (for example, library functions). Component diagrams can be displayed at a very high level so that only coarse-grained components can be displayed, or they can be displayed at package level 2.

The modeling of component diagram is best described by examples. Figure 7 shows four components: ReportingTool, BillboardService, Servlet2.2API, and JDBCAPI. The arrowhead segment from the ReportingTool component to the BillboardService, Servlet2.2API, and JDBCAPI components indicates that ReportingTool depends on those three components.

7. Deployment diagram

The deployment diagram in the commonly used UML diagram shows how the software system is deployed to the hardware environment. Its purpose is to show where the different components of the system will run physically and how they will communicate with each other. Because the deployment diagram is to model the physical operation, the production personnel of the system can make good use of it.

The symbols in the deployment diagram include the symbol elements used in the component diagram, and several symbols have been added, including the concept of nodes. A node can represent a physical machine or a virtual machine node (for example, a mainframe node). To model the node, simply draw a three-dimensional cube with the name of the node at the top of the cube. The naming convention used is the same as in the sequence diagram: [instance name]: [instance type] (for example, "w3reporting.myco.com:ApplicationServer").

The above is about the content of this article "what are the commonly used UML diagrams?" I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report