In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
What is a class diagram?
UML class diagrams are used to describe the static structure of a system. It can be used for both general conceptual modeling and detailed modeling. Class contains data and behavior, is an important part of object-oriented, it is the same attributes, operations, relationships of the general collection of objects.
UML class diagrams can also be used for data modeling. It can be used to describe the structure of objects and information within an application or with other users. Problem domains are eventually transformed in UML, modeled by classes, and constructed by programming languages. Classes and their relationships form a class diagram, which can also include elements such as interfaces, packages, and instances such as objects and chains.
Symbol class in class diagram
The class is represented by a rectangle, separated into three parts by two straight lines, as shown in the figure:
Attribute
The properties section of the class lists each property of the class on a separate line. The properties section is optional, but when used, it contains each property of the class displayed in list format. Each line uses the format: Name: Attribute Type (e.g. Name: Character Type).
Operation (Operation)
The actions are recorded in the bottom area of the class diagram rectangle, which is also optional. Like attributes, the actions of a class are displayed in list format, with each action on its own line. Record the operation using the following symbols: Name (parameter list): Type of return value
(e.g. setting name (name parameter) :void).
relationship association
An association specifies a whole/part relationship between two classes. In an association relationship, objects of the entire class take objects of some classes as instance data. In the class diagram, associations appear as directed solid lines.
One-way association:
In a one-way association, two classes are related, but only one class knows that the relationship exists. The one-way association is drawn as a solid line with open arrows pointing to the known classes.
bidirectional (standard) association
Is a link between two classes. Associations are always considered bidirectional; this means that both classes know about each other and their relationship, unless you define an association as something else.
The solid line between the two classes indicates a bidirectional association.
diversity
Place multiple symbols at the end of an association. These symbols represent the number of instances of one class linked to an instance of another class.
For example, a company will have one or more employees, but each employee will work for only one company.
There are several types of relationships:
Relationship Description 11 to 10.. 10 or 1 * Multiple 0.. * 0 or more 1.. * 1 or more visibility
Used to indicate who has access to information contained in the classes represented by +, -,#, and ~, as shown in the figure:
superclass
The relationship between a superclass and a more specific thing called a subclass.
Generalization is sometimes called "being a" relationship, established through a process of inheritance.
In the class diagram, generalized relationships appear as solid lines with large open arrows pointing to the parent class.
Abstract classes and methods
In an inheritance hierarchy, subclasses implement specific details, while parent classes define the framework for their subclasses. Parent classes also provide templates for common methods that will be implemented by their children.
The name of an abstract class is usually displayed in italics; alternatively, an abstract class can be displayed with a text comment, also known as template {abstract}, after or below its name.
An abstract method is a method that has no implementation. To create an abstract method, create an operation and skew it.
achieve
An implementation is a relationship between two things, where one thing (an interface) specifies a contract and the other thing (a class) guarantees execution of that contract by implementing the operations specified in that contract.
In the class diagram, implementation relationships appear as dashed lines with open arrows pointing to interfaces.
dependent
A dependency represents a "usage" relationship between two classes.
In the class diagram, dependencies appear as dashed lines.
If category A "uses" category B, one or more of the following statements are usually true:
Among one or more methods of class A, class B is used as a type of local variable. Class B is used as a parameter type of one or more methods of class A. Class B is used as a return type of one or more methods of class A. One or more methods of class A invoke one or more methods of class B.
The Making of Class Map
There are many ways to create class diagrams. If you choose to draw class diagrams online, you can use visio or use the online drawing website: freedgo Design. freedgo Design can be accessed at www.example.com. https://www.freedgo.com freedgo design online drawing website is a multi-type graphic diagram design software, software content comes with a wealth of geometric graphics templates, UML use case diagrams, state diagrams, class diagrams, activity diagrams, sequence diagrams, collaboration diagrams and so on.
The business logic needs to be broken down into smaller, more specific steps in a concrete class diagram. Then, consider any possible anomalies in the class graph and, if so, add decision nodes for alternative paths.
Continue repeating this process until you reach simple steps that everyone can fully understand.
Now, let's see how to use Freedgo Design to make beautiful class diagrams.
Step 1:
Visit https://www.freedgo.com, register a user first, log in to the home page after successful registration
Step 2:
Visit https://www.freedgo.com/draw_index.html to go to the drawing page, or click Start from the menu at the top of the home page.
Go to the drawing page and click File-> New from Type-> Software Design-> Class Drawing
Or click on legend, find software design-> class diagram in legend, select a similar legend to change
Step 3:
Drag the appropriate geometry from the symbol bar on the left to the canvas, release it, and the geometry is pinned to the canvas. Double-click the geometry, and you can also enter text. When the mouse is placed over a graphic,
"Small triangles" will be displayed around the graphics to facilitate users to click to quickly generate new graphics.
Step 4:
The software provides a variety of connection styles, in which you can select associated connection lines. On the connecting line, you can also enter text for further instructions.
Step 5:
Class diagram making tool has a set of rich functions of the style, users can close the graphics for monochrome fill, gradient fill, text size position color adjustment. After the pattern filling, the appearance improved a lot.
Step 6:
According to the drawing requirements, complete the class drawing step by step. Finally completed the entire painting task.
For more examples of basic class diagrams, please refer to [Legend] (https://www.freedgo.com/showcase.html) or visit https://www.freedgo.com/showcase.html directly
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.