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

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

Share

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

How to understand the UML public mechanism, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

Learn about the UML common mechanism with you, and the editor explains the modification and extension mechanism in more detail.

UML public mechanism

① comments (note)

Annotations are graphical symbols attached to an element or set of elements to represent constraints or annotations. 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 of 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 in the UML common mechanism is to add a tag with {content} under the name of the UML's 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.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

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