You are on page 1of 23

COMMON MECHANISMS

By M. Hanumanthu
INTRODUCTION
• The UML id made simple by the presence of
four common mechanisms that apply
consistently throughout the language:
Specifications, adornments, common divisions
and extensibility mechanisms
Terms and Concepts
Notes
• Graphically, a note is rendered as a rectangle
with a dog-eared corner, together with a
textual or graphical comment.
• A note may contain combination of text or
graphics.
• A note accepts
– live URL
– link to or embed another document
Adornments
• are textual or graphical items that are added to an
element’s basic notation and are used to visualize
details from the element’s specification.
• Rule: start with basic notation for each element and
then add other adornments only as they are necessary
to convey specific information that is important to
your model.
• Placed near element as Text or graphics.
• Special compartments for adornments in
– classes
– components
– nodes
Tagged Values
• Everything in the UML has its own set of
properties:
– classes have names, attributes and operations
– associations have names and two or more ends
• With Stereotypes,
– You can add new things to the UML
– with tagged values..you can add new properties
Tagged Values
• A tagged value is not same as a class attribute.
Rather, you can think of a tagged value as
metadata because its value applies to the element
itself, not its instances.
• Example:
Tagged Values
• Tagged value is rendered as a string enclosed by
brackets and placed below the name of another
element
• The string includes a name (the tag), a separator
(the symbol = ), and a value (of the tag)
• These are commonly used to specify information
relevant to code generation, configuration
management and so on
Constraints
• Constraints are used to create rules for the model
• Rules that impact the behavior of the model, and
specify conditions that must be met
• Can apply to any element in the model, i.e., attributes
of a class, relationship
• Graphically represented as a string enclosed by
braces {....} and placed near the associated elements
or connected to that elements by dependency
relationships
• A constraint specifies conditions that must be held
true for the model to be well-formed.
COMMON MODELING TECHNIQUES

 Modeling Comments
 Modeling New Building Blocks
 Modeling New Properties
 Modeling New Semantics
1. Modeling Comments
• Put the comment as text in a note and place it
adjacent to the element to which it refers.
• Remember that you can hide or make visible the
elements of your model as you see fit.
• if the note is lengthy, then write down the
complete description in a document and place a
link in the note referring the document.
• As the model evolves keep those comments that
are significant, otherwise remove
2. Modeling New Building Blocks
• Make sure there’s not already a way to express what
you want by using basic UML. If you have a
common modeling problem, chances are there’s
already some standard stereotype that will do what
you want.
• After conforming the above select any one of the
eleven things (example: class, interface, component,
node association etc.) and stereotype it. Stereotyping
can be done in two ways
– Selecting a stereotype which already exists
– Creating our own stereotype
2. Modeling New Building Blocks
• 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.
3. Modeling New Properties
• First, make sure there’s not already a way to express
what you want by using basic UML. If you have a
common modeling problem, chances are that there’s
already some standard tagged value that will do
what you want.
• If you are convinced there’s no other way to express
these semantics, add this new property to an
individual element or a stereotype. the rules of
generalization apply-tagged values defined for one
kind of element apply to its children
4. 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 have a
common modeling problem, chances are that there’s
already some standard constraint that will do what you
want.
– if you are convinced there’s no other way to express
these 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
End

You might also like