Beruflich Dokumente
Kultur Dokumente
Meta Modeling
Universität Freiburg
24.05.2006
Metamodeling
Intro
What?
meta = above
Define an ontology of concepts for a domain.
Define the vocabulary and grammatical rules of a modeling
language.
Define a domain specific language (DSL).
Why?
Concise means of specifying the set models for a domain.
Precise definition of modeling language.
How?
Grammars and attributions for textbased languages.
Metamodeling generalizes to arbitrary languages (e.g.,
graphical)
Metamodeling
Uses
Construction of DSLs
Validation of Models
(checking against metamodel)
Model-to-model transformation
(defined in terms of the metamodels)
Model-to-code transformation
Tool integration
Terms
abstract syntax
Expr = Const String
| Var String
| Binop Op Expr Expr
Op = Add | Sub | Mul | Div
E ::= c | x | E B E | (E)
B ::= + | − | ∗ | /
2 * (x + 3)
Terms/Abstract Syntax
Example: UML class diagram
concrete syntax
Person
name
salary
raise()
abstract syntax
:Class
name = "Person"
describes instanceof
Typ: Classifier
ID: 764535
M2: Metamodel
Name: Klasse
Features: Attributes, Operations, Ass
describes instanceof
Typ: Klasse
ID: 21436456
M1: Model Name: Person
Attribute: Name, Firstn.
describes instanceof Operations: ...
Association: ...
Customer Order
M0: System
Customer Customer Order
M1: Model
name: String
Model
Element
can throw
Association Class
Meta vs Abstract
M3
MOF
<<instanceof>>
M2
PIM− PSM−
Metamodel Metamodel
"abstract" M1
PIM PSM
Transformation
UML::Class
generalizes
<<instanceof>>
MOF::Classifier
<<instanceof>>
CM::Component
<<instanceof>>
<<instanceof>>
(3) (5)
<<component>>
CustomAdmin::Person CustomAdmin::Person
CustomAdmin::Person
UML::Class
<<CM::Component>>
CustomAdmin::Person
{transactional = true}
CM::Component
transactional: boolean
M3
MOF
"meta" <<instanceof>>
M2
Base metamodel
UML Metamodel
"base"
Metamodel Metamodel
Domain 1 Domain 2
<<instanceof>> <<instanceof>> M1
"meta" <<instanceof>>
Applicationsmodel Applicationsmodel
Domain 2 UML Model Domain 1
Extension Using Stereotypes (UML 1.x)
<<stereotye>>
<<metaclass>> <<stereotype>> CM::Component
{<<taggedValue>>
UML::Class transactional}
definition use
<<stereotype>> <<CM::Component>>
<<metaclass>>
UML::Class CM::Component CustomAdmin::Person
{transactional = true}
transactional: boolean
PackageImport
appliedProfile
Package ProfileApplication
{subsets
1 importedPackage} n
n
1
/metaclass n
Extension Property
Class 1 /extension 1
{subsets ownedMember}
owned
Stereotype type
Stereotype ExtensionEnd
n
n 1
Example Profile for EJB
<<profile>>
EJB
<<stereotype>> <<stereotype>>
EntityBean SessionBean
<<stereotype>>
JAR
Artifact
<<enumeration>> <<stereotype>>
StateKind Remote
Interface
stateful
stateless <<stereotype>>
Home
Further Aspects of Profiles
<<metaclass>>
UML::Attribute
name: String
type: Type
[...]
context Attribute:
<<metaclass>>
inv: Type.Name == "String"
CM::ConfigParam