Title: UML Meta Models II Unification of Static and Dynamic Semantics
1UML Meta Models II-Unification of Static and
Dynamic Semantics
- A Study in redefining the Semantics of the UML
using the pUML OO Meta Modeling Approach - Anneke Kleppe and Jos Warmer
- Klasse Objecten
- http//www.klasse.nl
2Objectives
- The static and dynamic viewpoints on the system
can not be separated. - The meaning of a model written in UML must be
expressed to be understood by users.
3Same Semantics for Different Views
44 Layered Meta Model Again!
5KernelPackage
6(No Transcript)
7Core.model.concepts Package I
- Model Element
- a part of a specification or model in UML
- Container
- a Model Element that is able to contain other
Model Elements. - Classifier
- a Model Element that defines a set of definitions
(or rules) according to which Values can be
classified.
8Core.model.concepts Package II
- Definition
- a definition of an aspect of a Value.
- Synonyms Rule, Property, Feature.
- Immutable Type
- a definition of Values that are immutable.
- Role
- a classifier, therefore a set of rules, including
an instance of this type is mutable, and an
instance of this type may have references to
other instances
9Core.model.concepts Package III
- Name
- a reference. (Needs to be instantiated in order
to pick one UML variant.Usually it takes the form
of a string type.) SynonymVariable.
10Well-Formedness Rules
- Uniqueness of names
- No circular inheritance
- A generalizable element must confirm to its
paprents
11(No Transcript)
12Definitions in core.instance Package
- Domain Element
- an element that can be reasoned about (specified,
modeled) using the UML. - Local Snap shot
- a collection of Name Value Bindings for a certain
Mutable Value at a certain point in time. - Name Value Binding
- a combination of a Name (reference) and a Value
13(No Transcript)
14Definitions of core.instance II
- Value
- a Domain Element that represent some of the
elements of the world that can be modeled in UML - Mutable Value
- a Value that has slots of which the value may
change. - Immutable Value
- a Value that cannot change, or be changed.
15Definitions of core.instance III
- Null Value
- a Value that represents void (null, nil).
- Object
- a Mutable Value that has a state, represented in
a Local Snapshot, and is able to change that
state thereby creating a new Local Snapshot.
16Well Formedness Rules
- A name value binding contains name and value
- A mutable value contains its snapshots
- History of an object is ordered.
- Slot values of a local snapshot of a mutable
value may not contain the local snapshot self - Additional Operations
- allPredecessors( )
- The collection of all previous snapshots
17Core Semantics Package
18Core.semantics Package
- Class a mutable value that represents a role
- confirmsTo() is as in pUML metamodel.
19(No Transcript)
20The Features Package
- StructFeatureDef a definition of a feature that
will not execute and/or change state. - DynFeatureDef a definition of a feature that may
execute and may change state. - InvariantDef a definition of a rule, mostly
based on structural features. - ParamDef a definition with a Parameter Direction
Kind, that can be actualized by an actual
parameter. - ParameterDirectionKinda definition of an
enumeration that denotes if the parameter is used
for supplying an argument and/or for returning a
value.
21TheImmutablesPackage
22Definitions in Immutables
- CollectionType
- a type that defines values that can hold other
values. - DataType
- a classifier, therefore a set of rules,
including, an instance of this type is immutable,
and an instance of this type has no references to
other instances - EnumerationType
- a type that defines a limited set of values.
23(No Transcript)
24immutables.semantics
25The Associations Package
26Why only Unary ?
27Why Only Unary ? - Explanation
- A one way association to be a restriction of a
two way association where one is the inverse of
the other. - Consider the previous diagram. The definition is
recursive. Hence defining inverse is difficult
28The Associations Package
- Unary Association
- a structural feature that can be used to
reference another mutable value - Hence, type can only be a role, or a collection
type - Multiplicity Kind
- An indication of the number of elements in the
collection of the unary association.
29Well-formedness Conditions
- When the multiplicity is zero or one
- the type of a unary association is equal to its
associated classifier. - When the multiplicity is zero to many, or one to
many, - The type of a unary association is equal to the
pre-defined type set, and this set has as element
type the role of the unary association.
30(No Transcript)
31The Action Package - I
- Action Expression
- a model element with indicating a value, or an
action. - Feature Ref
- a reference or a call to a definition
- Primitive Action
- an action that specifies a change of the snapshot
of the mutable value that executes the action
32The Action Package - II
- Data Value Exp
- an expression of data values and operations.
- Create Object Action
- an expression specifying a change of the snapshot
of a class so that the slot new contains a new
object- an instance of that class. - Read Action
- an expression that specifies a certain value.
- Write Action
- an action that specifies a change of the value.
33(No Transcript)
34(No Transcript)
35Compound Actions Package
- Idea Add
- Loops, Conditional actions, Group actions
- All sub-actions of a compound action are executed
by the same object. - Form the Paper
- Making UML Activity Diagrams Object-Oriented
Tools Europe 2000
36(No Transcript)
37(No Transcript)
38(No Transcript)
39The Messaging Package
- Every object is extended with an input and an
output queue, - both of which may contain signals.
- Two new subclasses of Primitive Action
- SendAction
- puts a signal in the output queuea
- ProcessSignalAction.
- takes a signal out of the input queue.
40(No Transcript)
41message.instance.concepts Package
- Bus
- a transport mechanism that transports signals
from output queue to input queues. - Signal Instance
- an occurrence of a signal.
- SendSignalExec
- Execution of the sending of a signal, i.e.
putting a signal with its content in the out-put
queue - ProcessSignalExec
- Execution of the receipt of a signal, i.e.
taking a signal with its content from the input
queue
42(No Transcript)
43message.signal.semantics Package
44(No Transcript)
45Self Description and OCL-some known problems-
- Predefined OCL operations (oclIsTypeOf, includes,
etc.) are not defined in this meta model, but
will be fixed in OCL 2.0 - Some symbols are overloaded, such as
- roles use the class symbol
- Inheritance symbol for parent-child relationship
- Association symbol for associations between roles
etc.
46State Machines
- For statechart diagrams
- This view point is not compatible with the
thinking - the object has a state machine, OR
- the objects state machine does
- Two options
- Either the state machine is an attribute of the
primary object. - it is equal to the primary object This option is
taken
47State Machines
48Well Formedness Rules
- The test of a Transition is an AND combination of
its guard, and its from-State. - The result-type of the state must be of Boolean
type. - Only roles may have states.
- The to and from states of a transition must
belong to the same class as the transition.
49State Machine Instance Package
50State Machine Instance Package
- The test of a Transition-Exec checks whether the
signal-Instance is in the input queue of its self
object. - The sub-action of a Transition-Exec is a
Conditional-Action-Exec. - A Transition-Exec may only be executed by a
mutable value that has a role that has states for
which transitions are defined.
51(No Transcript)
52More on Statecharts
- The stateMachine package could have been defined
without introducing the concepts State and
Transition. - How?
- rewriting of the well-formedness rules to apply
to the parent concepts - Invariant-Def AND
- Conditional-Action.
53Sequence and Collaboration Diagrams
- Interaction diagrams show messaging, form the two
syntaxes for the messaging package. - Both of the interaction diagrams show items on
the instance level. - Only a collaboration diagram may also be used as
a model diagram, when it is used for role
modeling.
54Sequence and Collaboration Diagrams
- Need to establish a relation between
- messaging package AND
- Graph-Symbols package on two levels
- Why two levels?
- Once, for the role modeling of collaboration
diagram, - To the model sub-package of messaging
- At the level of the Instance Sub-package for
- Sequence diagrams
- Collaboration diagrams