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 model elements and general mechanisms in UML language

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

In this article, the editor introduces in detail "what are the model elements and the general mechanism in the UML language" with detailed content, clear steps and proper handling of the details. I hope that this article "what are the model elements and the general mechanism in the UML language" can help you solve your doubts.

Model element

The model elements in the UML language include the relationship between things and things. Things are an important part of UML, and they represent anything that can be defined. The relationship between things can connect things together to form a meaningful structural model. Each model element has a corresponding graphical element.

I. things

In UML language, things can be divided into structural things, action things, grouped things and annotated things.

1. Structural things

Structural things are divided into: classes, interfaces, collaboration, use cases, activity classes, components and nodes

(1) Class. A class is an abstraction of objects with the same properties, methods, relationships, and semantics, and a class can implement one or more interfaces. The class is represented by a rectangle that includes the class name, properties, and methods.

(2) Interface. An interface is a collection of operations that provide specific services to a class or component.

(3) collaboration. Collaboration defines interaction. Some characters work with other elements to provide collaborative actions that are larger than the sum of the elements. The ellipse is represented by the dotted line of coaction in UML.

(4) use case. Use cases describe a series of actions that the system performs on a particular role. In the model, use cases are usually used to organize action things, which are realized through collaboration. In UML, use cases are represented by solid ellipses marked with the name of the use case.

(5) activity type. An active class is a class whose class object has one or more processes or threads. In UML, the representation of the active class is the same as that of the class, except that the border is in bold lines.

(6) components. A component is a physically replaceable part of a system that implements a collection of interfaces.

(7) nodes. A node is a physical element that exists at run time and represents a computable resource that usually takes up some memory and has processing power. A collection of components is generally located on one node, but it can also be moved from one node to another.

2. Action things

In UML language, action things are the dynamic parts of the UML model. They are the verbs of the model, representing the actions in time and space. Interaction and state machine are the two most basic dynamic elements in UML model.

(1) interaction. Interaction is a series of actions composed of a series of message exchanges carried out by a group of objects in a specific context to achieve a specific purpose. Each operation of the object that makes up the action in the interaction is listed in detail, including the message, the number of actions (actions generated by the message), and the connection (the connection between objects).

(2) State machine. The state machine consists of the states of a series of objects.

3. Grouping things

Grouped things are part of the organization in the UML model, and there is only one kind of grouped things, called packages.

4. Annotate things

Annotated things are the explanatory part of the UML model.

II. Relations in UML language

1. Association relationship

The association relationship connects the element and the link instance, which is represented by a solid line connecting two model elements, and the roles and multiplicity tags of both sides of the association can be marked at both ends of the association.

2. Dependency relationship

Dependencies describe the attachment of one element to another. Dependencies are represented by dashed lines with arrows from the source model to the target model.

3. Generalization relation

Generalization relationships, also known as inheritance relationships, are represented by a solid line with a hollow triangular arrow, pointing from the subclass to the parent class.

4. Realization relationship

The implementation relationship describes how one element implements another.

5. Polymerization relationship

The aggregation relationship describes the relationship between parts and the whole, that is, a model element that represents a whole may be aggregated by several model elements that represent parts.

General mechanism

First, retouching.

When modeling in the UML language, you can attach graphical decorations to model elements in UML diagrams. For example, when an element represents a type, its name can be displayed in bold glyph classes; when the same element represents an instance of that type, the element's name is decorated with an underscore.

Second, comments.

In the UML language, a dotted line connects comments to the elements it interprets or refines.

Third, general division.

The UML language defines two general types of model elements: type-instance (value) and interface-implementation.

1. Type-instance (Type-Instance): describes the correspondence between a common descriptor and a single element item. The instance element uses the same graphic representation as the generic descriptor, but the representation of the name is different from the generic descriptor: the instance element name is underlined, followed by a colon and a generic descriptor.

2. Interface-implementation: the interface declares a contract that defines the service, and the implementation of the interface is responsible for executing all the semantic definitions of the interface and implementing the service.

After reading this, the article "what are the model elements and general mechanisms in UML language" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself. If you want to know more about related articles, you are 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