Presentation is loading. Please wait.

Presentation is loading. Please wait.

Common Mechanisms in UML

Similar presentations


Presentation on theme: "Common Mechanisms in UML"— Presentation transcript:

1 Common Mechanisms in UML

2 Is UML enough? UML is a well defined language BUT …….
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 Is UML enough?

3 Simplification of UML Through Four common mechanisms Specifications
Adornments : A note is a graphical symbol for rendering constraints or comments attached to an element or a collection of elements. Common Divisions Extensibility Mechanisms : The UML's extensibility mechanisms permit you to extend the language in controlled ways These mechanisms include stereotypes, tagged values, and constraints. Simplification of UML

4 Specifications Specify- give details
Each and every thing can be specified say class, use case etc E.g. Class implies a full set of attributes, operations, full signatures and behaviors Specifications can be included in the class, or specified separately Specifications

5 Browser, Diagram, Documentation
Rational Rose Windows

6 Rational Rose Specifications
For Class Rational Rose Specifications

7 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. Adornments

8 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 Other Adornments

9 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. Extensibility Mechanisms

10 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

11 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 caught Can make them first class citizens in your model, ie treating them like basic building blocks, by marking them with a suitable stereotype Stereotypes

12 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

13 Stereotypes Approaches for stereotypes Named stereotype
Named stereotype with icon Stereotyped element as icon Stereotypes

14 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

15 Tagged Values Not the same as a class attribute
Can 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

16 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

17 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

18 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) Tagged Values

19 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

20 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

21 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 Constraints

22 Among multiple elements
Constraints

23 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 Guidelines for use

24 Common Modeling Techniques
Modeling Comments Common Modeling Techniques

25 Common Modeling Techniques
Modeling New Building Blocks Common Modeling Techniques

26 Common Modeling Techniques
Modeling New Properties Common Modeling Techniques

27 Common Modeling Techniques
Modeling New Semantics Common Modeling Techniques

28 Thank You

29


Download ppt "Common Mechanisms in UML"

Similar presentations


Ads by Google