Mappings, Use of MOF for Language Families

advertisement
J.Fischer
Mappings,
Use of MOF for
Language Families
Joachim Fischer
Workshop on
Integrated Application of Formal Languages
Geneva, 13 September 2003
J.Fischer
Workshop on Integrated Application of Formal Languages, Geneva 2003
1
The Problem
convenient methods
to combine
different specification languages
SDL
MSC
ASN.1
TTCN
URN
ULF
ODL
in a model-driven
software development process
Clif: (1) Language integration is only be useful if there is also tool
integration
(2) Language integration is tool-dependent
J.Fischer
Workshop on Integrated Application of Formal Languages, Geneva 2003
2
requirement
models
environment
models
analysis models
design models
implementation
models
deployment
models
J.Fischer
diversity of
modelling
techniques:
concept space with
notation and semantics
platform
models
Workshop on Integrated Application of Formal Languages, Geneva 2003
Model-based Software Development
requirements
3
requirement
models
environment
models
analysis models
design models
Petri nets
...
SDL
;
dcl p Pid
process B
dcl i Natural,
c Character;
implementation
models
B
process B2
B2-1
B1
B2
deployment
models
J.Fischer
B2
platform
models
Workshop on Integrated Application of Formal Languages, Geneva 2003
B2-3
B2-2
Model-based Software Development
requirements
4
Kinds of Language Combinations
…in a software development process
1. switch from one development level to another
UML
 UML
requirement
rough design
analysis
 SDL
…
detailed design
2. decomposition of a complex system
eODL  SDL
 UML
 existing implementation
SDL + ASN.1
3. switch from one abstraction level to another
SDL  MSC
J.Fischer
Workshop on Integrated Application of Formal Languages, Geneva 2003
5
Classic Methods of Language Combinations
1) Integration of languages to a new language
2) Translation between the languages
Problems
• large effort (for each language pair a new mapping)
• restrictions on expressive power by reducing the
languages
• right mix of concrete notations
• restrictions on further modifications
• large effort for adaptation of existing tools
J.Fischer
Workshop on Integrated Application of Formal Languages, Geneva 2003
6
Models, Notations and Concept Space
• Concepts
theoretical building stones for abstract models of specific problem
domain – represented in special notations
• Concept space
– concept collection for a complete model construction
with
– relations between these concepts and
– specific construction rules
• Abstraction Process
–
–
–
–
–
J.Fischer
classification, exemplification
generalisation, specialisation
structuring, organisation
capsulation, information hiding
behaviour description
Workshop on Integrated Application of Formal Languages, Geneva 2003
7
Meta-Models
Meta-Meta-Model
(M3)
Model
(M1)
Meta-Model
(M2)
Original
(M0)
Concept
~ abstract grammar
Notation
Original
Concept
~ ebnf
Notation
Original
Concept
~ concrete grammar
Notation
J.Fischer
Workshop on Integrated Application of Formal Languages, Geneva 2003
Original
8
Alternative Approach: Language Integration by
Meta-modelling
J.Fischer
•
language definition in M2 layer (meta-model)
– defines concepts
– may be manipulated (Extension, Specialization, Structural
adaptation)
•
definition of semantic separated from language notation
– no coupling to „grammar technologies“
– suitable (graphical) notation can be selected!
– integration of languages with different notations is possible
•
common meta-metamodel is a suitable way for a language integration
– relations between meta-models (SDL  UML),
– construction of a merged meta-model (language) is possible
Workshop on Integrated Application of Formal Languages, Geneva 2003
9
Grammar versus Meta-Model
Grammar
Meta-Model
•
strict and clear association
between semantics and
syntactical structures
•
•
compiler tool support for
textual languages (yacc, lex)
•
•
association diversity of
different notations
(in particular graphical
notations)
simple and flexible
possibilities for restriction and
extension of the concept
space
creation support of model
element repository
Combined use
Structure of the concept space: abstract grammar or metamodel
Relation between concept space and notation: transformation
Semantics: defined for an special (example) notation
Notation: concrete grammar
J.Fischer
Workshop on Integrated Application of Formal Languages, Geneva 2003
10
SDL Language Definition
syntax
dynamic
semantics
execution
transformation
SDL
Abstract machine
static
semantics
Abstract
Grammar
SDL/PR
SDL/GR
Well-formedness
conditions
ASM
J.Fischer
Workshop on Integrated Application of Formal Languages, Geneva 2003
11
SDL Language Definition (alternative)
syntax
dynamic
semantics
execution
transformation
SDL
Abstract machine
static
semantics
SDL
Meta-model
Well-formedness
conditions
SDL/PR
SDL/GR
UML
Profile
For SDL
ASM
J.Fischer
Workshop on Integrated Application of Formal Languages, Geneva 2003
12
Meta-Model for SDL: The Method
well- formedness by
PC1
syntax by bnf
grammar
Z100.F2
simple
meta-model
meta-data
repository
Constrains
model
fragments
Open question
- What is a good meta-model?
target
meta-model
J.Fischer
Workshop on Integrated Application of Formal Languages, Geneva 2003
13
Language Combination
as combination of their concept spaces
concepts of
language A
concepts of
language B
combined
concept space
• visually reflected by one or more existing notations
(partially or complete)
 a combination of the concrete notations is not necessary
 but important: availability of methods for concept spaces
J.Fischer
Workshop on Integrated Application of Formal Languages, Geneva 2003
14
Language Combination
as combination of their concept spaces
The way
• selection of the common concepts of the languages
(common kernel, definition of reference points)
• estimation of the method to connect the individual
concept spaces with the kernel
• technical Realisation of the concept space
(widely independent of available tools)
J.Fischer
Workshop on Integrated Application of Formal Languages, Geneva 2003
15
Concept Space Kernel for SDL and MSC
Further
concepts
Base
concepts
Further
concepts
generalisation
J.Fischer
Concepts
Of
Language A
Concepts
Of
Language B
Notation A
Notation B
Workshop on Integrated Application of Formal Languages, Geneva 2003
16
Concept Space Kernel for Data Types
Meta-model
for data types
Further
concepts
Base
concepts
Further
concepts
generalisation
ASN.1
J.Fischer
Concepts
Of
Language A
Concepts
Of
Language B
Notation A
Notation B
Workshop on Integrated Application of Formal Languages, Geneva 2003
SDL Data types
17
Basic Principles for a Concept Space API
• necessary for the exchange and combination of models
• realised as (a set of)
– interface definitions (CORBA or Java)
– header files (C or C++)
• 1:1 relation:
concepts of the language - interface
• generalisation/specialisations of concepts:
by inheritance of the interfaces
• all other relations (associations, compositions, …) and
attributes:
by references over get and set methods
J.Fischer
Workshop on Integrated Application of Formal Languages, Geneva 2003
18
Normative APIs for Concept Spaces
Existing APIs
• for read, write and model modifications
• are unfortunately specific to
the tool and not to the language:
Examples
– RoseAPI (RationalRose for UML)
– CMCS Client API (Cinderella API for MSC)
• Price: Tool adaptations for model / tool combination
• Solution: standardized and tool-independent approach for API
Example: MOF (OMG)
J.Fischer
Workshop on Integrated Application of Formal Languages, Geneva 2003
19
MOF - Meta Object Facility
meta-model
as
XML document
framework for
 specification, construction
 management, exchange
 integration
of meta-data
MOF
XMI
modelling tool
MOF
stored
meta-model
MOF
IDL
XMI
for
meta-model
creation, modification
…
of meta-models
IDL
for
meta-model
XMI defines rules to create
DTDs for meta-models
J.Fischer
Workshop on Integrated Application of Formal Languages, Geneva 2003
20
MOF – as Repository
read model
Modelling tool A
XMI
write model
Repository
API
Modelling tool B
J.Fischer
Version
management
stored
stored
models
models
Repository
- is the central information source for all tools
- has programmatic and
exchange interfaces
- the access is standardised,
but not implementation
Workshop on Integrated Application of Formal Languages, Geneva 2003
21
MOF – as Repository for Combined Languages
Repository A
stored
stored
Amodels
model
Repository B
stored
stored
Bmodels
model
J.Fischer
Repository T
stored
stored
models
Transformations
Repository C
stored
stored
Cmodels
model
• more than one repository
• connected by
- direct references (common kernel)
- separate repository of transformation rules
Code Generator
Workshop on Integrated Application of Formal Languages, Geneva 2003
executable
22
MOF Transformation Framework (MTF)
<<M (n+1)>>
Source Meta-model
<<M n>>
Source Model
<<M 2>>
Transfomation Meta-model
<<M 1>>
Transformation Model
Transform
<<M (n+1)>>
Target Meta-model
<<M n>>
Target Model
Restriction: structural transformation only
J.Fischer
Workshop on Integrated Application of Formal Languages, Geneva 2003
23
Conclusions
Problems with classic combination techniques
• compilation and language integration (large effort, restrictions on
expressive power)
Advantage of the meta-model approach
• two-dimensional description form with free correlation of notations
– suitable for languages with graphical notations
• faster technical realisation
– separation from concrete syntax
– creation support of model element repositories
– support for meta-model transformations
Open Issues
• criteria for good meta-models, efficient techniques for transformations
• research on pros and cons on meta-model approach
• combination of different semantics
J.Fischer
Workshop on Integrated Application of Formal Languages, Geneva 2003
24
Thank You !
Questions ?
J.Fischer
Workshop on Integrated Application of Formal Languages, Geneva 2003
25
Download