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

How to use UML use case Diagram and Class Diagram in UML drawing

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces how to use UML use case diagram and class diagram in UML graphics. It is very detailed and has certain reference value. Friends who are interested must finish reading it.

UML use case diagram

The use case diagram in the UML 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 the role and the use case is described with simple line segments, as shown in figure 1.

Figure 1: sample use case diagram

Icons (from top to bottom): CD sales system; view band CD sales statistics; band manager; view Billboard200 ranking report; record manager; view specific CD sales statistics; search * * Billboard200 ranking report; ranking report service

UML use case diagrams in UML diagrams are often used to express advanced functions of a system or system scope. As shown in figure 1, you can easily see the functionality provided by the system. The system allows band managers to view the band CD's sales statistics report as well as the Billboard200 ranking report. It also allows record managers to view specific CD sales statistics and those CD reports in the Billboard200 rankings. The figure also tells us that the system will provide Billboard ranking reports through an external system called "ranking report Service".

In addition, in the use case diagram, the use cases that are not listed indicate functions that the system cannot accomplish. For example, it doesn't give band managers a way to listen to songs from different albums on Billboard200-that is, the system doesn't reference a use case called "listening to songs on Billboard200." This lack is not a trivial matter. By providing a clear and concise description of the use case in the use case diagram, it is easy for project sponsors to see whether the system provides the necessary functionality.

Class diagram

The class diagram shows how different entities (people, things, and data) relate to each other; in other words, it shows the static structure of the system. Class diagrams in UML 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 using a three-part rectangle on the class diagram, as shown in figure 2. The top section shows the name of the class, the middle part contains the properties of the class, and the bottom part contains the actions (or "methods") of the class.

Figure 2: sample class object in the class diagram

In my experience, almost every developer knows what this class diagram is, but I find that most programmers can't describe class relationships correctly. For a class diagram like figure 3, you should draw inheritance relationship 1 with an arrow with vertices pointing to the parent class, and the arrow should be a complete triangle. For a class diagram in a UML diagram, if two classes know each other, solid lines should be used to represent the association; if only one of the classes knows the association, an open arrow should be used.

Figure 3: a complete class diagram, including the class objects shown in figure 2

In figure 3, we see both inheritance relationships and two associations. The CDSalesReport class inherits from the Report class. A CDSalesReport class is associated with a CD class, but the CD class does not know anything about the CDSalesReport class. Both the CD class and the Band class know each other, and each class can be associated with one or more other classes.

These are all the contents of the article "how to use UML use case diagrams and class diagrams in UML diagrams". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow 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