250 likes | 348 Views
J.Fischer. Mappings , Use of MOF for Language Families Joachim Fischer Workshop on Integrated Application of Formal Languages Geneva, 13 September 2003. The Problem. convenient methods to combine different specification languages
E N D
J.Fischer Mappings, Use of MOF for Language Families Joachim Fischer Workshop on Integrated Application of Formal Languages Geneva, 13 September 2003
The Problem convenient methods to combine different specification languages 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 SDL MSC ASN.1 TTCN URN ULF ODL
implementation models deployment models platform models requirements requirement models environment models analysis models Model-based Software Development diversity of modelling techniques: concept space with notation and semantics design models
dcl p Pid; Petri nets dcl i Natural, c Character; process B process B2 B2 B2-1 SDL B2-3 . B . B2-2 . implementation models B1 B2 deployment models platform models requirements requirement models environment models analysis models Model-based Software Development design models
Kinds of Language Combinations …in a software development process • switch from one development level to another UML UML SDL … requirement rough design detailed design analysis • decomposition of a complex systemeODL SDL SDL + ASN.1 UML existing implementation • switch from one abstraction level to anotherSDL MSC
Classic Methods of Language Combinations • Integration of languages to a new language • 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
Models, Notations and Concept Space • Conceptstheoretical 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 • classification, exemplification • generalisation, specialisation • structuring, organisation • capsulation, information hiding • behaviour description
Concept ~ abstract grammar Notation Original Concept ~ ebnf Notation Original Concept ~ concrete grammar Notation Meta-Models Model (M1) Meta-Meta-Model (M3) Original (M0) Meta-Model (M2) Original
Alternative Approach: Language Integration by Meta-modelling • 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
Grammar versus Meta-Model Meta-Model • 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 Grammar • strict and clear association between semantics and syntactical structures • compiler tool support for textual languages (yacc, lex) 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
SDL Language Definition syntax dynamic semantics static semantics SDL/PR SDL/GR SDL Abstract machine Abstract Grammar transformation Well-formedness conditions execution ASM
SDL Language Definition (alternative) syntax dynamic semantics static semantics SDL/PR SDL/GR SDL Abstract machine SDL Meta-model transformation Well-formedness conditions execution UML Profile For SDL ASM
well- formedness by PC1 syntax by bnf grammar Z100.F2 simple meta-model Constrains model fragments meta-data repository target meta-model Meta-Model for SDL: The Method Open question - What is a good meta-model?
combined concept space Language Combination as combination of their concept spaces • 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 concepts of language A concepts of language B
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)
Further concepts Further concepts Concept Space Kernel for SDL and MSC Base concepts generalisation Concepts Of Language B Concepts Of Language A Notation B Notation A
Further concepts Further concepts Concept Space Kernel for Data Types Meta-model for data types Base concepts generalisation Concepts Of Language B Concepts Of Language A ASN.1 SDL Data types Notation B Notation A
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
Normative APIs for Concept Spaces Existing APIs • for read, write and model modifications • are unfortunately specific tothe 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 APIExample: MOF (OMG)
meta-model as XML document modelling tool MOF creation, modification … of meta-models MOF IDL MOF XMI stored meta-model IDL for meta-model XMI for meta-model MOF - Meta Object Facility • framework for • specification, construction • management, exchange • integration of meta-data XMI defines rules to createDTDs for meta-models
read model Modelling tool A Version management XMI write model API Modelling tool B MOF – as Repository Repository stored models stored models • Repository • is the central information source for all tools • has programmatic and exchange interfaces • the access is standardised, • but not implementation
Repository T stored models stored Transformations MOF – as Repository for Combined Languages Repository C Repository A stored models stored models stored C model stored A model • more than one repository • connected by • direct references (common kernel) • separate repository of transformation rules Repository B stored models stored B model executable Code Generator
MOF Transformation Framework (MTF) <<M 2>> Transfomation Meta-model <<M (n+1)>> <<M (n+1)>> Source Meta-model Target Meta-model <<M 1>> Transformation Model <<M n>> <<M n>> Transform Source Model Target Model Restriction: structural transformation only
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
Thank You ! Questions ?