metamodel global view - the university of texas at dallaschung/fujitsu/m05_metamodel.pdfmodels and...
TRANSCRIPT
Met
amodel
Global view
Som
e so
urc
es
�Object Modeling with UML: Advanced Modeling, Karin Palmkvist, Bran
Selic, and JosWarmer, March 2000
�UML 2.0 Superstructure Specification, OMG,
2004.
Rev
iew
: In
stan
ces
and C
lass
es
Instances: tokens, specific things
Classes: collections of instances
Rev
iew
: In
stan
ces
and C
lass
es
Instances: tokens, specific things
Classes: collections of instances
Why?
Model
s an
d M
etam
odel
s
Specific models: tokens, specific things, and relationships
Generic models: collections of instances, and relationships
Metamodels: ontology, …and epistemology, of generic models
Model
s an
d M
etam
odel
s
Specific models: tokens, specific things, and relationships
Generic models: collections of instances, and relationships
Metamodels: ontology, …and epistemology, of generic models
Why?
Model
s an
d M
etam
odel
s
Specific models: tokens, specific things, and relationships
Generic models: collections of instances, and relationships
Metamodels: ontology, and epistemology, of generic models
Why?
What is meta-modeling?
�Generally, the analysis, construction and development of the frames, rules,
constraints, models and theories applicable and useful for the modeling
in a predefined class of problems.
�In computer scienceand related disciplines, the construction of a collection of
"concepts" (things, terms, etc.) within a certain domain.
�A modelis an abstraction of phenomena in the real world, and
a metamodelis yet another abstraction, highlighting properties of the model itself.
�A model should conform to its metamodel
like a program conforms to the grammar of the programming language in which it is written.
http://en.wikipedia.org/wiki/Meta-modeling
“A valid metamodelis an ontology,
but not all ontology are modeled explicitly as metamodels”[Söderström2002].
Met
a-m
odel
Capitalization
A meta-model defines concepts
and their relationships thanks to
a class diagram.
A meta-model only defines
structure (no semantic).
A model is an instance of a meta-
model if it respects the structure
defined by the meta-model.
The UML meta-model defines the
structure that all UML models
must have.
An Example:
UML metamodelin the 4 Layer
Another Example:
UML metamodelin the 4 Layer
Com
ponent
0..1
0..1
0..1
ownedElement
Com
ment
*Lin
k
1..*
1..*
1..*
Enum
era
tionLitera
l
Pro
gra
mm
ingLanguageType
Enum
era
tion
Prim
itiv
e
******
1..*
*
Obje
ct
Para
mete
r
defaultValue
kind
Insta
nce
Nam
espace
specialization
*parent
*child
GeneralizableElement
isRoot
isLeaf
isAbstract
Package
Model
Subsyste
mD
ata
Type
Inte
rface
deploymmentLocation
*resident
*
Associa
tionC
lass
Cla
ss
Node
owner
{ordered}
participant
*
specification *
Associa
tionEnd
isNavigable
aggregation
multiplicity
connection
2..*
2..*
2..*
Associa
tion
Meth
od
body
Opera
tion
isAbstract
0..1
qualifier
*
Attribute
initialValue
{ordered}
*
specification
***** *
*type
Genera
lization
discriminator
Feature
visibility BehaviouralFeature
StructuralFeature
multiplicity
Classifier
ModelElement
name
Element
Relationship
*
*
type
importedElement
*
*
UML Meta Model
Metaclasses used in class, package, component and deployment diagrams
www.site.uottawa.ca/ftppub/courses/ Winter/seg3310/coursenotes/Lecture7-8-Metamodelling.ppt
Map
pin
g of U
ML M
odel
s to
Met
amodel
Ele
men
ts (E
xam
ple
)
Customer
Account
accountN
umber
balance
overdraftLim
it
CreditCard
expiryDate
*1..2
withdraw
deposit Saving
Chequing
BankSystem
Genera
lization
discriminator
Relationship
Associa
tion
Relationship
Associa
tionEnd
isNavigable
aggregation
multiplicity
Cla
ss
Classifier
Nam
espace
Package
Attribute
initialValue
StructuralFeature
multiplicity
Meth
od
BehaviouralFeature
www.site.uottawa.ca/ftppub/courses/ Winter/seg3310/coursenotes/Lecture7-8-Metamodelling.ppt
Poin
ts to P
onder
�Can we create a new version of UML, in
consideration of the following?
M3
M2
M1
M0
Meta-metamodeling
� abstract language
� specific paradigm
(e.g., OO)
� application independent
Metamodeling
� abstract language
� specific paradigm (e.g., OO)
� application specific
� process or notation
modeling, etc.
Modeling
� concrete language
� specific paradigm (e.g., OO)
� specific model
� describes the data needed
Information
� applied in "real world"
� specific paradigm (e.g., OO)
� specific project
Metamodeling
Architecture
Examples
USPM
(RUP)
metamodel
MOF standard
(OO paradigm)
RUP
model
UML
standard
…
Project
X
Process
standa
Project
X
Artifacts
UML
metamodel
standard
… … …
MetaClass, MetaAttribute, MetaOperation
Class, Attribute, Operation, Component
StockShare, owner, askPrice
hacsSoftwareCoShare99, smartie, 11.18
Met
a-m
eta-
model
�MOF defines the language
for defining meta-models
�MOF concepts are meta-
class, meta-attribute, meta-
association, etc.
�MOF concepts and their
relationships can be defined
by a class diagram. This
diagram is also a meta-
model (called the meta-
meta-model)
�The meta-meta-model is
self defined.
Met
a-la
yers
Capitalization
MOF
UML
Modèle
Modèle
Modèle
Meta-meta-model
UML
UML
Meta-model
Model
�Mn+1 defines the
structure of Mn
�Mn+1 is not an
abstraction of Mn
�Meta-layer relationships
are similar to grammar-
layer relationships
(BNF, or XML Schema)
Infr
astr
uct
ure
: C
onso
lidat
ion o
f
Conce
pts
Nam
esp
ace
Nam
esp
ace
Nam
esp
ace
Pac
kag
able
Ele
men
tP
acka
gab
leE
lem
ent
Pac
kag
able
Ele
men
tR
edef
inab
leE
lem
ent
Red
efin
able
Ele
men
tR
edef
inab
leE
lem
ent
Cla
ssif
ier
Cla
ssif
ier
Cla
ssif
ier
Fea
ture
Fea
ture
Fea
ture
Infr
astr
uct
ure
: B
ehav
ior H
arm
oniz
atio
n
�Common semantic base for all behaviors
�Choice of behavioral formalism driven by application
needs C
lass
ifie
rC
lass
ifie
r
. . .
. . .
Cla
ssC
lass
Cla
ssU
seC
ase
Use
Cas
eU
seC
ase
Co
mp
on
ent
Co
mp
on
ent
Co
mp
on
ent
Beh
avio
rB
ehav
ior
0..1
0..1
0..*
0..*
Act
ion
Act
ion
Act
ion
Act
ivit
yA
ctiv
ity
Act
ivit
yS
tate
mac
hin
eS
tate
mac
hin
eS
tate
mac
hin
eIn
tera
ctio
nIn
tera
ctio
nIn
tera
ctio
n
Cla
ssifie
r &
Cla
ss
Com
mon c
om
ponen
t par
adig
m
cd c
om
ponent
Com
ponent
- kind: ComponentKind = COMPOUND
Port
Part
«enumeration»
Com
ponentK
ind
+ COMPOUND:
+ ELEMENTARY:
+ REPETITIVE:
Vector
facto
rization::
Multip
licity
Connecto
r
*+connector
1
+owner
0..1
+multiplicity
*+part
1+owner
1+type
0..1
+multiplicity
*
+port
1+owner
Composing
Assembling
Encapsulation
Repetition of
structural
elements
UM
L2.0
Com
ponen
t
Inte
rface
Cla
ss
Com
ponent
Realization
Cla
ssifie
r
+/provided
*
+/required
**
+abstraction
1
+realization *
+realizingClassifier
1
Obje
ctC
onst
rain
tLan
guag
e
�OCL defines the structure of
models expressing constraints
�Invariant, Pre-post conditions
�OCL is a meta-model instance
of the MOF
�OCL is highly coupled with
UML
�The OCL semantic is defined
with models (operation without
side effect )
�OCL defined a concrete syntax
Capitalization
PropertyCallExp
>
Literal
-1000
ModelPropertyCall
amount
Cla
ss
+balance
BankA
ccount
{context BankAccount
inv: balance > -1000
}Constr
ain
t Expre
ssio
n
Expre
ssio
nIn
Ocl
OclE
xpre
ssio
n
ModelE
lem
ent
**
1
*
**
Act
ion S
eman
tics
�AS defines the structure of
models expressing
sequences of actions
�AS was a meta-model and
is now completely
integrated in UML2.0
�AS has no concrete syntax
(UML diagram)
�The semantic of AS is not
formally defined (an RFP is
published)
Capitalization
Tem
pla
te
�Model transformation is a template written in
a dedicated language
Productivity
PetStore
PetStore
EJB
UML
EJB
Template
Interpretor
UML2EJB
Template
Colla
bora
tion
Model
s &
Tra
ceab
ility
A model is an abstraction of a system, specifying the system from a certain
viewpoint and at a certain level of abstraction
Model
& S
yste
m H
iera
rchy
�Models and subsystems can be combined in
a hierarchy:
Ste
reoty
pe
Nota
tion