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 is the concept of UML public mechanism

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

Share

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

This article will explain in detail what the concept of UML public mechanism is. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

UML public mechanism

In the previous sections of the introduction to UML, we mentioned the common mechanisms of UML, namely, specification, decoration, general partitioning, and extension mechanisms. This section provides a more detailed description of the modification and extension mechanisms.

① comments (note)

Annotations in the UML common mechanism are graphical symbols attached to an element or set of elements to represent constraints or comments. Annotations can contain text or diagrams or URL.

Principles of use:

The ⑴ should be placed in the corresponding element attachment, and the dependency should be used to connect the annotation to the corresponding element.

⑵ displays comments only when needed.

If the ⑶ comments are long, consider placing them in external text, using links to specify the location.

⑷ appropriately discards comments of unreserved value.

Other modifications of ②

For example, it is used to modify the associated roles, multiplicity, and so on. For classes, components, nodes, and so on, you can also add a separator bar at the bottom of the graph to fill in the decoration information.

③ stereotype (stereotype)

Stereotypes in the UML common mechanism are used to extend the vocabulary of UML, and you can think of stereotypes as metatypes, because each construct creates an equivalent to a new class in the UML metamodel. New building blocks can have their own specific features, semantics, and representations. The simplest stereotype can be to add a "name" to the UML thing graph.

Principles of use:

⑴ confirms that you can't express what you want to describe with basic UML.

⑵ should select the most similar graph from the UML basics to construct a new building block.

⑶ details the features and semantics of new building blocks by defining a set of tag values and constraints.

⑷ can use new icons on new building blocks in order to mark them more clearly.

④ tag value (toggedvalue)

The simplest tag value is to add a tag with {content} under the name of the UML thing graph. For example, specify the value of the enumerated type.

Principles of use:

⑴ confirms that the features you want to describe cannot be expressed in basic UML.

The rule of application of ⑵ generalization is that the tag values defined for an element can be applied to its descendants.

⑤ constraint

The use of constraints in the UML public mechanism can add new semantics or change existing rules. A constraint can be marked with {content} and placed near the related element.

Principles of use:

⑴ confirms that the semantics you want to describe cannot be expressed in basic UML.

⑵ places constraints on the attachments of the corresponding elements and connects them using dependencies.

If ⑶ needs to describe the new semantics more accurately and formally, it can be written in OCL. (OCL doesn't know what that means.)

In general, using basic UML can describe your system, and in some cases it may not fully meet your needs, so you can use extension mechanisms to make up for it. You should use the basic elements defined by UML whenever possible to ensure that your UML can be understood by others.

This is the end of the article on "what is the concept of UML public mechanism". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

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