Date post: | 21-Dec-2015 |
Category: |
Documents |
Upload: | griffin-hancock |
View: | 218 times |
Download: | 1 times |
Is UML enough?
UML is a well defined languageBUT …….Impossible to express ALL possible
nuances of ALL models across ALL domains across ALL time, SO……
Need to extend it to customize/tailor it to communicate YOUR intent
Must be done in a CONTROLLED way Solution: the UML Extension Mechanisms
Simplification of UML
Through Four common mechanismsSpecificationsAdornments : oA note is a graphical symbol for rendering
constraints or comments attached to an element or a collection of elements.
Common DivisionsExtensibility Mechanisms : oThe UML's extensibility mechanisms permit you
to extend the language in controlled waysoThese mechanisms include stereotypes, tagged
values, and constraints.
Specifications
Specify- give detailsEach and every thing can be specified say
class, use case etcE.g. Class implies a full set of attributes,
operations, full signatures and behaviorsSpecifications can be included in the
class, or specified separately
Adornments
Note is a graphical representation for comments and constraints
It also gives a placeholder to link to or embed other documents.
It can be used to specify things like requirements, observations, reviews, and explanations, in addition to rendering constraints.
Other Adornments
Association is a line adorned with multiplicity, role name etc.
In the case of some things classes, components, and nodes, we can add an extra compartment below the usual compartments to provide additional information
Extensibility Mechanisms
Different extensibility mechanisms that can applied to UML are
Stereotype: allows us to create new kinds of building blocks similar to existing ones but specific to your problem
Tagged value: allows us to create new information in that element's specification.
Constraint: allows us to add new rules or to modify existing ones.
Stereotypes
They can be thought as a metatype, because each one creates the equivalent of a new class in the UML's metamodel.
Each stereotype defines a set of properties that are received by elements of that stereotype
Stereotypes
Example: If you are modelling a network you might want to have symbols for routers and hubs.
Can make use of stereotyped nodes so that they appear as primitive building blocks
Another example: In Java, you sometimes have to model classes such as exceptions
Only want them to be thrown and caughtCan make them first class citizens in your
model, ie treating them like basic building blocks, by marking them with a suitable stereotype
Stereotypes
Graphically, a stereotype is rendered as a name enclosed by guillemots and placed above the name of another element (eg, <<name>>)
Alternatively, you can render the stereotyped element by using a new icon associated with that stereotype
Stereotypes
Approaches for stereotypesNamed stereotypeNamed stereotype with iconStereotyped element as icon
Tagged Values
Properties for specifying key-value pairs of model elements, where keywords are attributes
Extend the properties of a UML building block, allowing you to create new information in that elements specification
Can be defined for existing elements of the UML
You can also define tags that apply to individual stereotypes . Then, everything with that stereotype will have that tagged value
Tagged Values
Not the same as a class attributeCan be thought of as a metadata, since
its value applies to the element itself and not its instances
Example: In the release team of a project that is responsible for assembling, testing and deploying releases, you might want to keep track of the version number and test results for each major Subsystem
Can use tagged values to add this information to your models
Tagged Values
Another example: One of the most common uses of a tagged value is to specify properties that are relevant to code generation or configuration management.
So you can use tagged values to specify the programming language to which you map a particular class
Similarly, you can use them to specify the author and version of a component
Tagged Values
Properties for specifying key-value pairs of model elements, where keywords are attributes
Extend the properties of a UML building block, allowing you to create new information in that elements specification
Can be defined for existing elements of the UML
You can also define tags that apply to individual stereotypes . Then, everything with that stereotype will have that tagged value
Tagged Values
Graphically, a tagged value isrendered as a string enclosed bybrackets and placed below the name of another element
The string consists of a name (the tag), a separator (the symbol =),and a value (of the tag)
Constraints
Properties for specifying semantics or conditions that must be maintained as true for model elements
Extend the semantics of a UML building block, allowing you to add new rules, or modify existing ones
Constraints
Example: If you are modelling hard real-time systems, you might want to adorn your models with information about time budgets and dead-lines
Can use constraints to capture these timing requirements
Constraints
Graphically, a constraint is rendered as a string enclosed by brackets and placed near the associated element(s) or connected to that element(s) by dependency relationships
This notation is also used as an adornment to the basic notation of an element to visualize parts of an element’s specification that have no graphical cue
For example, some properties of associations(order and changeability) are rendered using constraint notation
Guidelines for use
Keep in mind that an extension deviates from the standard form of the UML and may therefore lead to interoperability problems
So when you find yourself in the situation where you have to colour outside the lines you should do so in controlled ways
Carefully weigh benefits and costs before using the extension mechanisms