metamodel global view - the university of texas at dallaschung/fujitsu/m05_metamodel.pdfmodels and...

30
Metamodel Global view

Upload: trinhkhuong

Post on 16-Mar-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

Met

amodel

Global view

Page 2: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

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.

Page 3: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

Rev

iew

: In

stan

ces

and C

lass

es

Instances: tokens, specific things

Classes: collections of instances

Page 4: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

Rev

iew

: In

stan

ces

and C

lass

es

Instances: tokens, specific things

Classes: collections of instances

Why?

Page 5: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships 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

Page 6: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships 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?

Page 7: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships 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?

Page 8: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

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

Page 9: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:
Page 10: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

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.

Page 11: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

An Example:

UML metamodelin the 4 Layer

Page 12: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

Another Example:

UML metamodelin the 4 Layer

Page 13: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

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

Page 14: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

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

Page 15: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

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

Page 16: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

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.

Page 17: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

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)

Page 18: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

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

Page 19: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

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

Page 20: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

Cla

ssifie

r &

Cla

ss

Page 21: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

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

Page 22: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

UM

L2.0

Com

ponen

t

Inte

rface

Cla

ss

Com

ponent

Realization

Cla

ssifie

r

+/provided

*

+/required

**

+abstraction

1

+realization *

+realizingClassifier

1

Page 23: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

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

*

**

Page 24: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

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

Page 25: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

Tem

pla

te

�Model transformation is a template written in

a dedicated language

Productivity

PetStore

PetStore

EJB

UML

EJB

Template

Interpretor

UML2EJB

Template

Page 26: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:
Page 27: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

Colla

bora

tion

Page 28: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

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

Page 29: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

Model

& S

yste

m H

iera

rchy

�Models and subsystems can be combined in

a hierarchy:

Page 30: Metamodel Global view - The University of Texas at Dallaschung/Fujitsu/M05_Metamodel.pdfModels and Metamodels Specific models: tokens, specific things, and relationships Generic models:

Ste

reoty

pe

Nota

tion