1 of UML -- things

Source: Internet
Author: User
Tags node server

There are four types of things in the UML language:

Structured things: Static components of a language. There are 7 types of elements: class and object, interface, active class, use case, collaboration, component, and node.

Behavior thing: a dynamic component of language, indicating the changes and states of things.

Grouping things: the elements and packages of grouping things in the model.

Note: Mark, annotate, and explain the things in the model.

 

I. Structured things

Structured things define a physical element in a business or software system and describe the static features of things. Commonly used nouns for structured things. There are seven types of structured things: class and object, interface, active class, use case, collaboration, component, and node.

1. Classes and objects

A class is an abstraction of the common features of a group of objects with the same attributes, the same operations, and the same relationship. A class is an object template and an object is an instance of a class.

(1) Class Representation

In UML, a class is represented by a rectangle. It contains three areas, the top is the class name, the middle is the class attribute, and the bottom is the class method.

For example, the description of people (class) is graphically represented, as shown in 1.

Assume that the people class contains the following attributes and behaviors:

Class Name: people, in the first column.

Field name: name, age, and field name (also called attribute) are placed in the second column.

Method Name: Speak () and breathe (). The method is in the third column.

 

Figure 1: People class Representation

(2) Object Representation

An object is represented by a rectangle. In a rectangle, the attribute name and method name are no longer written, but an object is represented in the format of "Object Name: Class Name" in the rectangle.

For example, figure 2 of the object Zhang lianhai in the class people is shown.

 

Figure 2: Representation of the object "Zhang lianhai" 

2. Interface

Because the external use of classes (or components) is implemented through the class (or component) method, the set of operations that provide specific services for classes or components is called an interface. The API declares to the outside world the services it can provide.

There are two types of interfaces: supply interface and demand interface. The supply interface can only provide services to other classes (or components). The demand interface indicates that classes (or components) use other classes (or components) provided services.

The two interfaces are represented in method 3.

Figure 3: interface Representation

3. Active class

An active class means that the object created by this class has at least one process or thread and controls the execution of the task through the process or thread.

The expression of the active class is similar to that of the general class, but the outer frame is a rough line description.

As shown in expression 4 of the active class "radio.

Figure 4: active class Representation

4. Use Cases

In the system, a series of actions performed to complete a task to implement a certain function. We call the set of these actions as case instances. Use Cases describe the common features of a group of use case instances. The relationship between use cases and use case instances is just like the relationship between classes and objects.

The use case is represented by a solid-line elliptic, and the name of the use case is written into the elliptic. For example, use case "User Logon" to indicate 5

Figure 5: Use Case "User Logon"

5. Collaboration

Collaboration refers to meaningful interaction, that is, interaction between a group of objects to complete a task.

Implementation of Use Cases: Realize the interaction between a group of objects in a use case, that is, to represent the interaction (collaboration) between multiple objects in a use case ). Essentially, collaboration is the implementation of use cases.

Collaboration is represented by a dotted-line elliptic with two columns. For example, when the use case "selling real estate" is represented by "selling real estate" in collaboration, its corresponding representation is 6.

 

 

Figure 6: Collaborative "selling real estate"

6. Component

Components are also called components: in the system design, a relatively independent software component hides the functional implementation part inside and declares a set of interfaces (including the supply interface and the demand interface ). Therefore, two components with the same interface can be replaced with each other.

A component is a software component larger than a "class", such as a COM component, a DLL file, and an execution file.

The component is usually represented by a rectangle with two small boxes, as shown in figure 7.

 

Figure 7: component Representation

7. Nodes

A node is a physical component in a hardware system. It usually has a storage space or processing capability. For example, PCs, printers, and servers are all nodes. In UML, a cube is used to represent a node. As shown in figure 8.

Figure 8: node server Representation

Ii. Behavior

Behavioral things are used to describe interactions between things or changes in the state of things in business systems or software systems. Behavioral things describe the dynamic characteristics of things. Action is represented by a verb. There are two types of behavior things: interaction and state machine.

1. Interaction

Interaction is used to complete the interaction between objects of a task. This function is accomplished by sending and receiving information.

The interaction representation is very simple. A directed line is used to represent the interaction between objects, and a message name is marked on a directed line. 9.

Figure 9: Interaction Representation

2. State Machine

A state machine (statemachine) migrates an object from one State to another under the event-driven life cycle of an object. These state sequences constitute a state machine, namely, A state machine consists of multiple States.

In the UML model, the State is represented as a rounded rectangle and the state name is identified within the rectangle. As shown in, "wait" indicates 10.

Figure 10: Representation of the "Waiting" status

3. group things

For a medium or large software system, it usually contains a large number of classes, interfaces, and interactions, so there will be a large number of structured and behavioral things, to effectively classify and manage these things, you need to group them. In UML, "packages" are provided to achieve this goal.

A graphical symbol used to represent a package. It is similar to a graphical symbol used to represent a folder in windows. The role of a package is similar to that of a folder. The expression 11 of the "Data Access" package is shown in.

Figure 11: Representation of the "Data Access" Package

4. Comment on things

In the model, the part used to explain other things (text interpretation) is called annotation. A comment is a rectangle folded in the upper right corner. The explanatory text is written in the rectangle. The comment symbol 12 is shown.

Figure 12: annotator

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.