UML Tutorial for Beginners
Blog containing resources for uml like lecture notes, lecture videos, lab manual, uml diagrams, objective bits, important questions and more.
Subscribe to Startertutorials.com's YouTube channel for different tutorial and lecture videos.

Categories: Structural Modeling. 5 Comments on Common Mechanisms

UML provides the basic notations to visualize, specify, construct and document the artifacts of a software intensive system. Sometimes, the user might need to represent information through notations which are not available in UML.

 

In such circumstances, we can use the extensibility mechanisms like stereotypes, tagged values and constraints which are a part of common mechanisms in UML.

 

UML supports an annotational thing known as a note. A note is used to provide comments or reviews or also for documentation.

 

Stereotypes, tagged values and constraints are the mechanisms provided by the UML to extend the building blocks, the properties and the semantics. For example we can represent routers and hubs using stereotyped nodes.

 

We can maintain version numbers and the author name by using tagged values. We can specify certain range of values or other types of rules using constraints.

 

Note

 

A note is used to specify things like: requirements, observations, reviews, explanations and constraints. A note may contain simple text or graphical symbols. A note has no effect on the semantics of a model means it does not alter the meaning of the model.

 

Other Adornments

 

Adornments are textual or graphical items that are added to the elements basic notation to specify extra information. When using UML, always start with the basic notation of elements and add adornments to specify new information. Example: adornments of an association.

 

uml adornments

 

Stereotypes

 

UML provides basic notations for structural things, behavioral things, grouping things and annotational things. Sometimes we may need to extend i.e., create new vocabulary and look like primitive building blocks.

 

Stereotypes allows us to create new building blocks. Using stereotypes we can use the basic elements but with special properties, semantics and notation. Stereotypes are rendered as text inside guillemets(<< >>) or we can create new icons for stereotypes.

 

uml stereotypes

 

Tagged Values

 

Every element in UML has its own properties. For example a class has its own attributes and operations. Using tagged values, we can represent new properties also called as metadata. These properties apply to the element itself rather than its instance. Tagged values are enclosed in braces { } and are written under the element name.

 

uml tagged values

 

Constraints

 

A constraint is used to add new semantics or change existing rules. The constraints specify rules that must be followed by the elements in the model. Represented as text inside braces { } and placed near to the associated element.

 

uml constraints

 

Common Modeling Techniques

 

Modeling Comments

 

To model a comment:

  • Put your comment as text in a note and place it adjacent to the element to which it refers. You can show a more explicit relationship by connecting a note to its elements using a dependency relationship.
  • Remember that you can hide or make visible the elements of your model as you see fit.
  • If your comment is lengthy or involves something richer than plain text, consider putting your comment in an external document and linking or embedding that document in a note attached to your model.
  • As your model evolves, keep those comments that record significant decisions that cannot be inferred from the model itself, and unless they are of historic interest discard the others.

 

modeling comments in uml

 

Modeling New Building Blocks

 

To model new building blocks:

  • Make sure there’s not already a way to express what you want by using basic UML.
  • If you’re convinced there’s no other way to express these semantics, identify the primitive thing in the UML that’s most like what you want to model (for example, class, interface, component, node, association, and so on) and define a new stereotype for that thing.
  • Specify the common properties and semantics that go beyond the basic element being stereotyped by defining a set of tagged values and constraints for the stereotype.
  • If you want these stereotype elements to have a distinctive visual cue, define a new icon for the stereotype.

 

modeling new building blocks in uml

 

Modeling New Properties

 

To model new properties:

  • First, make sure there’s not already a way to express what you want by using basic UML.
  • If you’re convinced there’s no other way to express these semantics, add this new property to an individual element or a stereotype.

 

modeling properties in uml

 

Modeling New Semantics

 

To model new semantics:

  • First, make sure there’s not already a way to express what you want by using basic UML.
  • If you’re convinced there’s no other way to express these semantics, write your new semantics as text in a constraint and place it adjacent to the element to which it refers. You can show a more explicit relationship by connecting a constraint to its elements using a dependency relationship.
  • If you need to specify your semantics more precisely and formally, write your new semantics using OCL.

 

For example, below figure models a small part of a corporate human resources system:

modeling semantics in uml

 

How useful was this post?

Click on a star to rate it!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Suryateja Pericherla

Suryateja Pericherla, at present is a Research Scholar (full-time Ph.D.) in the Dept. of Computer Science & Systems Engineering at Andhra University, Visakhapatnam. Previously worked as an Associate Professor in the Dept. of CSE at Vishnu Institute of Technology, India.

He has 11+ years of teaching experience and is an individual researcher whose research interests are Cloud Computing, Internet of Things, Computer Security, Network Security and Blockchain.

He is a member of professional societies like IEEE, ACM, CSI and ISCA. He published several research papers which are indexed by SCIE, WoS, Scopus, Springer and others.

Note: Do you have a question on this article or have a suggestion to make this article better? You can ask or suggest us by filling in the below form. After commenting, your comment will be held for moderation and will be published in 24-48 hrs.

5 Comments

You can follow any responses to this entry through the RSS 2.0 feed.

It’s actually a great and helpful piece of information. I am
satisfied that you shared this useful info with us.
Please keep us up to date like this. Thank you for sharing.

Spot on with this write-up, I honestly believe that this web site needs far more attention. I’ll probably be returning to read through more, thanks for the advice!

Thanx Bro:)

pls make it short the answer…

    Hi,

    If it is for your exam, there is no need to write common modeling techniques. You can eliminate them.

Leave a Reply

Your email address will not be published. Required fields are marked *