Top Banner
Common Mechanisms in UML
29

Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

Dec 21, 2015

Download

Documents

Griffin Hancock
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

Common Mechanisms in UML

Page 2: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

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

Page 3: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

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.

Page 4: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

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

Page 5: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

Rational Rose Windows

Browser, Diagram, Documentation

Page 6: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

Rational Rose Specifications

For Class

Page 7: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

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.

Page 8: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

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

Page 9: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

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.

Page 10: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

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

Page 11: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

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

Page 12: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

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

Page 13: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

Stereotypes

Approaches for stereotypesNamed stereotypeNamed stereotype with iconStereotyped element as icon

Page 14: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

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

Page 15: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

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

Page 16: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

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

Page 17: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

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

Page 18: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

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)

Page 19: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

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

Page 20: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

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

Page 21: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

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

Page 22: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

Constraints

Among multiple elements

Page 23: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

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

Page 24: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

Common Modeling Techniques

Modeling Comments

Page 25: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

Common Modeling Techniques

Modeling New Building Blocks

Page 26: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

Common Modeling Techniques

Modeling New Properties

Page 27: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

Common Modeling Techniques

Modeling New Semantics

Page 28: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.

Thank You

Page 29: Common Mechanisms in UML. Is UML enough? UML is a well defined language BUT ……. Impossible to express ALL possible nuances of ALL models across ALL domains.