900 likes | 1.07k Views
MDA Praktisch Modellbasierte Java Entwicklung Markus Völter voelter@acm.org www.voelter.de. Table of Contents. MDA/D Introduction and Overview Metamodelling Example Metamodel Implementing the metamodel Generating Code The future: Model Transformations Summary. Table of Contents.
E N D
MDA Praktisch Modellbasierte Java Entwicklung Markus Völtervoelter@acm.orgwww.voelter.de
Table of Contents • MDA/D Introduction and Overview • Metamodelling • Example • Metamodel • Implementing the metamodel • Generating Code • The future: Model Transformations • Summary
Table of Contents • MDA/D Introduction and Overview • Metamodelling • Example • Metamodel • Implementing the metamodel • Generating Code • The future: Model Transformations • Summary
Characterizing 3D • The following mindmap originates from a BoF Meeting at OOPSLA 2003 which tried to characterize the essential properties of Domain Driven Development, and also relate things such as • GP • MDA • ...
Characterizing 3D Model
Characterizing 3D Model Domain Specific Language
Characterizing 3D semantics Model Domain Specific Language
Characterizing 3D knowledge semantics Model Domain Specific Language
Characterizing 3D knowledge semantics Model Domain Specific Language Metamodel
Characterizing 3D knowledge semantics Model Domain Specific Language graphical Metamodel textual
Characterizing 3D knowledge Domain semantics Model Domain Specific Language graphical Metamodel textual
Characterizing 3D bounded area of knowlege/interest knowledge Domain semantics Model Ontology Domain Specific Language graphical Metamodel textual
Characterizing 3D bounded area of knowlege/interest knowledge Domain semantics Model Ontology precise/ Domain executable Specific Language graphical Metamodel textual
Characterizing 3D subdomains bounded area of partial knowlege/interest multiple knowledge viewpoint Domain semantics Model Ontology precise/ Domain executable Specific Language graphical Metamodel textual
Characterizing 3D subdomains bounded area of partial knowlege/interest composable multiple knowledge viewpoint Domain semantics Model Ontology precise/ Domain executable Specific Language graphical Metamodel textual
Characterizing 3D Metametamodel subdomains bounded area of partial knowlege/interest composable multiple knowledge viewpoint Domain semantics Model Ontology precise/ Domain executable Specific Language graphical Metamodel textual
Characterizing 3D Metametamodel target subdomains software architecture bounded area of partial knowlege/interest composable multiple knowledge viewpoint Domain semantics Model Ontology precise/ Domain executable Specific Language graphical Metamodel textual
Characterizing 3D Metametamodel target subdomains software software architecture architecture bounded area of partial knowlege/interest composable multiple knowledge viewpoint Domain semantics Model Ontology precise/ Domain executable Specific Language graphical Metamodel textual
Characterizing 3D Metametamodel target subdomains software software architecture architecture bounded area of partial knowlege/interest composable multiple knowledge viewpoint transform Domain semantics Model Ontology precise/ Domain executable Specific Language graphical Metamodel textual
Characterizing 3D Metametamodel target subdomains software software architecture architecture bounded area of partial knowlege/interest composable multiple knowledge viewpoint transform Domain compile semantics Model Ontology precise/ Domain executable Specific Language graphical Metamodel textual
Characterizing 3D Metametamodel target subdomains software software architecture architecture bounded area of partial knowlege/interest composable multiple knowledge viewpoint transform Domain compile semantics Model Ontology interpret precise/ Domain executable Specific Language graphical Metamodel textual
Characterizing 3D Metametamodel target subdomains software software architecture architecture bounded area of partial knowlege/interest composable multiple knowledge viewpoint multi-step transform Domain single-step compile semantics Model Ontology interpret precise/ Domain executable Specific Language graphical Metamodel textual
Characterizing 3D Metametamodel target subdomains software software architecture architecture bounded area of partial knowlege/interest composable multiple knowledge viewpoint multi-step transform Domain single-step compile semantics Model Ontology interpret no precise/ Domain roundtrip executable Specific Language graphical Metamodel textual
Characterizing 3D several Metametamodel target subdomains software software designexpertise architecture architecture bounded area of partial knowlege/interest composable multiple knowledge viewpoint multi-step transform Domain single-step compile semantics Model Ontology interpret no precise/ Domain roundtrip executable Specific Language graphical Metamodel textual
Characterizing 3D several Metametamodel target subdomains software software designexpertise architecture architecture bounded area of partial knowlege/interest composable multiple knowledge viewpoint multi-step transform Domain single-step compile semantics Model Ontology interpret no precise/ Domain roundtrip executable Specific Language graphical Metamodel rapid textual evolution
Characterizing 3D several Metametamodel target subdomains software software designexpertise architecture architecture bounded area of partial knowlege/interest composable multiple knowledge viewpoint multi-step transform Domain single-step compile semantics Model Ontology interpret no precise/ Domain roundtrip executable Specific Language graphical Metamodel rapid textual evolution customizability
Characterizing 3D several Metametamodel target subdomains software software designexpertise architecture architecture bounded area of partial knowlege/interest composable multiple knowledge viewpoint multi-step transform Domain single-step compile semantics Model Ontology interpret no precise/ Domain roundtrip executable Specific Language graphical Metamodel rapid textual evolution customizability software families
Characterizing 3D several Metametamodel target subdomains software software designexpertise architecture architecture bounded area of partial knowlege/interest composable multiple knowledge viewpoint multi-step transform Domain single-step compile semantics Model Ontology interpret no precise/ Domain roundtrip executable Specific Language graphical Metamodel rapid textual evolution customizability software families product lines
Characterizing 3D several Metametamodel target subdomains software software designexpertise architecture architecture bounded area of partial knowlege/interest composable multiple knowledge viewpoint multi-step transform Domain single-step compile semantics Model Ontology interpret no precise/ Domain roundtrip executable Specific Language graphical Metamodel rapid textual evolution customizability software families product lines portability
MDA? And MDA?
MDA Metametamodel target subdomains software software architecture architecture bounded area of partial knowlege/interest composable multiple viewpoint multi-step transform Domain single-step compile semantics Model Ontology interpret no precise/ Domain roundtrip executable Specific Language graphical Metamodel rapid textual evolution customizability software families product lines portability
MDA Metametamodel target subdomains software software architecture architecture bounded area of partial knowlege/interest composable multiple viewpoint multi-step transform Domain single-step compile semantics Model Ontology interpret no precise/ Domain roundtrip executable Specific Language UML+Profiles graphical Metamodel rapid textual evolution customizability software families product lines portability
MDA MOF Metametamodel target subdomains software software architecture architecture bounded area of partial knowlege/interest composable multiple viewpoint multi-step transform Domain single-step compile semantics Model Ontology interpret no precise/ Domain roundtrip executable Specific Language UML+Profiles graphical Metamodel rapid textual evolution customizability software families product lines portability
MDA MOF Metametamodel target subdomains software software architecture architecture bounded area of partial knowlege/interest composable multiple viewpoint multi-step transform Domain single-step compile semantics Model Ontology interpret no precise/ Domain roundtrip executable Specific OCL, Action Semantics Language UML+Profiles graphical Metamodel rapid textual evolution customizability software families product lines portability
MDA MOF Metametamodel target subdomains software software architecture architecture bounded area of partial knowlege/interest composable multiple viewpoint multi-step transform Domain single-step compile semantics Model Ontology interpret no precise/ Domain roundtrip executable Specific OCL, Action Semantics Language UML+Profiles graphical Metamodel rapid textual evolution customizability software families product lines portability
MDA MOF Metametamodel target subdomains software software architecture architecture bounded area of partial knowlege/interest composable PIM, PSM, .... multiple viewpoint multi-step transform Domain single-step compile semantics Model Ontology interpret no precise/ Domain roundtrip executable Specific OCL, Action Semantics Language UML+Profiles graphical Metamodel rapid textual evolution customizability software families product lines portability
MDA MOF Metametamodel target subdomains software software architecture architecture bounded area of partial knowlege/interest composable PIM, PSM, .... multiple viewpoint multi-step transform Domain single-step compile semantics Model Ontology interpret no precise/ Domain roundtrip executable Specific OCL, Action Semantics Language UML+Profiles graphical Metamodel rapid textual evolution customizability software families product lines portability
MDD defined • Model Driven Development (MDD) means developing executable software from higher-level models. • A Model in this context is defined to be some specification that cannot be directly executed on current mainstream platforms (such as Java, .NET, Intel x86, ...). • Models can be graphical (e.g. UML, Aris) or they can be textual (typically called DSLs, or Domain-Specific Languages). • Code, on the other side, is a directly executable artifact on current platforms. • Thus, the definition of what is a model and what is code is always relative to current mainstream platforms. • See comparison to lower level / higher level languages and compilers
How to execute models • Executing models can happen in different ways: • Models can be interpreted by a „model-VM“. Dirk Riehle‘s UML virtual machine is an example. • Typically, however, models are compiled into lower-level models or code, which is then executed (compiled or interpreted).
Abstraction and Concretization • To make model-driven development worthwhile, models must provide some higher level of abstraction over the platform on which they are executed. • This higher-level of abstraction is typically achieved by using domain-specific abstractions in the models. • „Domain specific“ can denote a business domain or a technical domain • UML models which show a box for each and every implementation class might be useful, but this is not an example of model-driven development. • These higher-level models are then typically transformed to more concrete models (and/or finally, code). • This can happen in a single step or in multiple steps. • The rules for such transformations must be specified somewhere.
Software System Families • Typically, MDD makes most sense in the context of software system families because developing modeling environments, generators, translators, etc. can be a lot of work and it pays only if reused. • What is a software system familiy?We consider a set of programs to constitute a family whenever it is worthwhile to study programs from the set by first studying the common properties of the set and then determining the special properties of the individual family members. Definition by Parnas
Examples for Software System Families • A set of projects in the same domain (banking, telecom switching, automotive diagnosis). • You might be able to generate recurring business logic from models. • A set of artifacts based on the same infrastucture (such as EJB) in one project. • Here, you might be able to to generate all the infrastructure-specific code around manually implemented business logic. • you have some specific business logic that you want to run on different platforms. • You might be able to generate platform-specific implementation code from the models (this is the focus of MDA) • a set of artifacts based on the same modelling paradigm, such as state chart. • You might be able to generate the complete implementation based on the model and its predefined mapping to lower-level implementations.
Models in MDA • This is a taxonomyof models in MDA (adapted from David Frankel‘s MDA book)
Models in MDA II • PIMs are independent of any particular implementation platform. They only capture the business logic – the problem space in terms of GP. • A series of model transformations is then applied to concretize the model for specific platforms. • Mapping rules (as covered later) are part of the core model definition – they operate on the metamodel defined by the core model.
Software System Families revisited • Developing an MDD infrastructure – however simple or sophisticated it may be – is always additional effort. • Such an infrastructure can include • A clearly defined system architecture • Modelling abstractions, metamodels and profiles • Model verifiers and design checkers • Reusable components and composition rules, frameworks and libraries • Generators and/or model interpreters • You only want to do this if this additional effort pays off! • Like with mass production, the amount of effort you put into the infrastructure must be less than the amount of effort you save when developing the products.
Product Line Engineering • Domain Scoping • Variability Analysis • Domain Structuring • Define common architecture • Define Production Plan • Define Building Blocks • Components • DSLs & Generators • Production Process
Variability Analysis • Variability analysis discovers the variable and fixed parts of a product in a domain. Parts can be • Structural or behavioral • Functional or non-functional (technical) • Modularized or aspectual • To define variable parts, we need to have a commonality base: a base platform, a common architecture • There are two kinds of variability: • positive variability: add something (optional) • negative variability: removes something (essential) • Positive variability leaves the concept intact, while netative variability does not.
Example Feature Diagram • Example products: • An aircraft with a low wing, piston engine and made of metal, wood and cloth: Robin DR-400 • An aircraft with shoulder wing, no engine and made of plastic: ASW-27 • An aircraft with low wing, jet engine(s) and made of metal: Airbus A320
Feature Diagrams cont‘d • They can contain constraints on the combinations of features • They can define „names“ for specific combinations of features; feature groups • Features can be open: additional subfeatures can be added • Features can be incomplete: the subfeatures are not yet defined • Multiplicity of subfeatures can be added • And more...