UML Tutorial for Beginners
Blog containing resources for uml like lecture notes, lecture videos, lab manual, uml diagrams, objective bits, important questions and more.

09/08/2013 Categories: Structural Modeling. No 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

 

Suryateja Pericherla

Suryateja Pericherla

Hello, I am Suryateja Pericherla working as an Asst. Professor in CSE department at Vishnu Institute of Technology. I write articles to share my knowledge and make people knowledgeable regarding certain topics.
Suryateja Pericherla

Latest posts by Suryateja Pericherla (see all)

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.

Leave a Reply

Scroll Up
Thank you for visiting startertutorials.com! If you like this website do share with your friends by clicking on the social icons available on the left hand side.

As the domain name is quite large to remember, use this short domain to visit this site. Short domain: stuts.me