UML Meta Models II- Unification of Static and Dynamic Semantic
Shared by: W7u5JOM6
-
Stats
- views:
- 10
- posted:
- 3/15/2012
- language:
- English
- pages:
- 54
Document Sample


-UML 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
swe699/IT 823 The Klasse-Objecten Meta Model 1
Objectives
• 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.
swe699/IT 823 The Klasse-Objecten Meta Model 2
Same Semantics for Different Views
swe699/IT 823 The Klasse-Objecten Meta Model 3
4 Layered Meta Model Again!
swe699/IT 823 The Klasse-Objecten Meta Model 4
Kernel
Package
swe699/IT 823 The Klasse-Objecten Meta Model 5
swe699/IT 823 The Klasse-Objecten Meta Model 6
Core.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.
swe699/IT 823 The Klasse-Objecten Meta Model 7
Core.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
swe699/IT 823 The Klasse-Objecten Meta Model 8
Core.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.) Synonym:Variable.
swe699/IT 823 The Klasse-Objecten Meta Model 9
Well-Formedness Rules
• Uniqueness of names
• No circular inheritance
• A generalizable element must confirm to its
paprents
swe699/IT 823 The Klasse-Objecten Meta Model 10
swe699/IT 823 The Klasse-Objecten Meta Model 11
Definitions 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
swe699/IT 823 The Klasse-Objecten Meta Model 12
swe699/IT 823 The Klasse-Objecten Meta Model 13
Definitions 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.
swe699/IT 823 The Klasse-Objecten Meta Model 14
Definitions 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.
swe699/IT 823 The Klasse-Objecten Meta Model 15
Well 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
swe699/IT 823 The Klasse-Objecten Meta Model 16
Core
Semantics
Package
swe699/IT 823 The Klasse-Objecten Meta Model 17
Core.semantics Package
• Class: a mutable value that represents a role
• confirmsTo(): is as in pUML metamodel.
swe699/IT 823 The Klasse-Objecten Meta Model 18
swe699/IT 823 The Klasse-Objecten Meta Model 19
The 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.
• ParameterDirectionKind:a definition of an
enumeration that denotes if the parameter is used for
supplying an argument and/or for returning a value.
swe699/IT 823 The Klasse-Objecten Meta Model 20
The
Immutables
Package
swe699/IT 823 The Klasse-Objecten Meta Model 21
Definitions 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.
swe699/IT 823 The Klasse-Objecten Meta Model 22
swe699/IT 823 The Klasse-Objecten Meta Model 23
immutables.semantics
swe699/IT 823 The Klasse-Objecten Meta Model 24
The Associations Package
swe699/IT 823 The Klasse-Objecten Meta Model 25
Why only Unary ?
swe699/IT 823 The Klasse-Objecten Meta Model 26
Why 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
swe699/IT 823 The Klasse-Objecten Meta Model 27
The 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.
swe699/IT 823 The Klasse-Objecten Meta Model 28
Well-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.
swe699/IT 823 The Klasse-Objecten Meta Model 29
swe699/IT 823 The Klasse-Objecten Meta Model 30
The 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
swe699/IT 823 The Klasse-Objecten Meta Model 31
The 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.
swe699/IT 823 The Klasse-Objecten Meta Model 32
swe699/IT 823 The Klasse-Objecten Meta Model 33
swe699/IT 823 The Klasse-Objecten Meta Model 34
Compound 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
swe699/IT 823 The Klasse-Objecten Meta Model 35
swe699/IT 823 The Klasse-Objecten Meta Model 36
swe699/IT 823 The Klasse-Objecten Meta Model 37
swe699/IT 823 The Klasse-Objecten Meta Model 38
The 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.
swe699/IT 823 The Klasse-Objecten Meta Model 39
swe699/IT 823 The Klasse-Objecten Meta Model 40
message.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
swe699/IT 823 The Klasse-Objecten Meta Model 41
swe699/IT 823 The Klasse-Objecten Meta Model 42
message.signal.semantics Package
swe699/IT 823 The Klasse-Objecten Meta Model 43
swe699/IT 823 The Klasse-Objecten Meta Model 44
Self 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
– 823 symbol for associations
swe699/ITAssociation The Klasse-Objecten Meta Model 45
State Machines
• For statechart diagrams
• This view point is not compatible with the
thinking
– the object has a state machine, OR
– the object’s 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
swe699/IT 823 The Klasse-Objecten Meta Model 46
State Machines
swe699/IT 823 The Klasse-Objecten Meta Model 47
Well 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.
swe699/IT 823 The Klasse-Objecten Meta Model 48
State Machine Instance Package
swe699/IT 823 The Klasse-Objecten Meta Model 49
State 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.
swe699/IT 823 The Klasse-Objecten Meta Model 50
swe699/IT 823 The Klasse-Objecten Meta Model 51
More 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.
swe699/IT 823 The Klasse-Objecten Meta Model 52
Sequence 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.
swe699/IT 823 The Klasse-Objecten Meta Model 53
Sequence 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
swe699/IT 823 The Klasse-Objecten Meta Model 54
Get documents about "