400 likes | 604 Vues
Model Driven Development. An introduction. Overview. • Using Models • • Using Models in Software • • Feasibility of MDA • • MDA Technologies • • The Unified Modeling Language • • What we are doing & Conclusion •. Using Models. Using Models. Examples. Precise models. Simulation
E N D
Model Driven Development An introduction
Overview • Using Models • • Using Models in Software • • Feasibility of MDA • • MDA Technologies • • The Unified Modeling Language • • What we are doing & Conclusion •
Using Models • Examples Precise models Simulation Verification Constructie
Using Models • Examples Electrician Interiordesigner Architect Marketing Different views … for each stakeholder … … all interconnected …
Using Models • Examples Structural view A bluilding in its environment A room in the building Zoom levels … information hiding … … understandability …
Using Models • Good models • Offer different views • Abstract away details [zooming] • Are understandable [symbols] • Are precise [and complete] • Follow common standards
Using Models • Why model? • Manage and understand great complexity • Experiment (simulate) • Communicate • Construction manual • User manual / documentation
if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements; if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements; if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements; if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements; if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements; if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements; Precise models Simulation Verification Using Models In Software • Many software projects Where are the Models?[code is a model too!] • But.. • One view • One level of detail • Not understandable • Not very abstract Construction
if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements; if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements; if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements; if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements; if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements; if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements; Precise models Simulation Verification Construction Using Models In Software • More positive ? (Long term) value?
Using Models In Software • Model Driven Development • Precise models [same goals as other industries] • Raising the abstraction level further • Separating application logic from the implementing technology • Automatic model transformations • Model Driven Architecture • MDD, the OMG way • Others are MS Software factories, Model IntegratedComputing, etc. • Common principles • We will talk mainly about MDA The MDA page - www.omg.org/mda The MDA vision - www.omg.org/docs/ormsc/01-07-01.pdf
Transformer Using Models In Software • Model once, Generate anywhere • Platform Independent Model • Platform Description Model • Platform Specific Model * (Mark) - Changing platform[C++|CORBA, J2EE, .NET] - Design decisions Essentialsystem concepts PIM PDM * PSM Code
Using Models In Software • Is this feasible? • Looking for a possible answer in SW history
Feasibility of MDA • Evolution Programming environment Platform “Use” 3GL Middleware Level of abstrction Level of abstrction Assembly Operating System 0’en en 1’en Hardware “Transform to” (“Compile to”) The increase of the level of abstraction at both sides is the enabler of MDA
Feasibility of MDA • Semantic gap closes MDA Model A Modeler’splayground Model B ModelTransformations Level of abstrction Model C 3GL with MW Level of abstrction Programmer’splayground 3GL with OS Machine code with OS Machine code The Abstract Platform - http://wwwhome.cs.utwente.nl/~alme/cvitae/almeida-edoc2004-abstractplatform.pdf
MDA Technologies • MDA is all about standards • Modeling • UML2 • CWM • … • Meta modeling • MOF • Model Exchange • XMI • UML Diagram interchange • Transformations • QVT • Templates • General scripts • … Model the application 2 Define your own language 1 Use different tools to … 3 … execute the necessary transformations 4
MDA Technologies • (Meta) modeling • A model has no meaning when separated from its meta model View A Zoom View B
MDA Technologies • 4 meta levels “Talk about” “Define” “Instance of” MOF - Meta Object Facility M3 UML, CWM, RDBM, your language M2 Classes, associations, operations, etc.Tables, keys, etc. M1 Objects, links, etc.Records etc. M0
1 * Person man:Person Name = Jan Name: String MDA Technologies • Applied to UML “Talk about” “Define” “Instance of” source M3 Class Association destination Class Attribute M2 M1 M0
MDA Technologies • Transformations MOF M3 UML RDBM Definetransformation M2 UML model RDBM model Applytransformation M1 MOF::Class(name=class) MOF::Class(name=table) UML::Class(name=person) RDBM::Table(name=person)
MDA Technologies • Transformations • Defined at the meta level • Executed at the model level • Source & target model • Replace / Add / Remove elements • Inter / Intra language • Transformation stages • From more abstract to more platform specific • E.g. UML A UML B(persistency) UML B(Logging) UML B(Language) TF 1 TF2 TF3
MDA Technologies • Transformations based on • Target language limitations • E.g. UML-UML[Java]: remove multiple inheritance • Aspects • Weave aspect models in the primary model • Model annotations • Using profiles Equivalence Rules for UML Class Diagrams, M. Gogolla, M. Richters An Aspect-Based Approach to Modeling Access Control Concerns, I. Ray, R. France, G. Georg An Introduction to UML Profiles, L. Fuentes-Fernández, A. Vallecillo-Moreno
MDA Technologies • Defining transformations • “The missing link” • Many specific - non standard - ways • Wait for QVT - Query, View, Transform • IBM Model Transformation Framework (MTF) MTF - www-128.ibm.com/developerworks/rational/library/05/503_sebas/ Query View Transform RFP - www.omg.org/cgi-bin/doc?ad/2002-4-10
MDA Technologies • Interoperability • Based on MOF • Model exchange - XMI • Reflective APIs - JMI, C(ORBA)MI, etc. Tool bus Transformation Tool Simulation Tool Desinger Tool ...
The Unified Modeling Language • What is it? • A visual modeling language • To specify software in a OO fashion • Now: UML 2.0 to better support MDA • What will we discuss? • Action Semantics • Profiles
The Unified Modeling Language • Most used in UML • Use case diagram • Class diagram • Communication/Sequence diagram
The Unified Modeling Language • We need to start using • State charts [state of an object] • Activity diagrams [state of an algorithm]
The Unified Modeling Language • Action Semantics • Really act upon your models • Create objects, set attributes, etc. • In a platform independent way • Using Activity diagrams • And/Or an Action Specification Language (ASL) • Mostly used in the xUML area Book (2004): Model Driven Architecture with Excutable UML UML 2.0 Activity and Action Models - http://www.jot.fm/issues/issue_2003_07/column3
The Unified Modeling Language • Profiles • Customization of UML (or any other MOF model) • The main uses of profiles are • Adding custom symbols to constructs • Adding semantics (for semantics variation points) • Adding constraints • Generally adding information (for transformations or documentation)
The Unified Modeling Language • Profiles • Annotations to standard UML models • Stereotypes, Tagged values and Constraints Definition Application
What we are doing • What are we doing? • Building experienced with UML 2.0 and all of its aspects in industrial cases • Looking how to specify traceability between transformations and how to explicitly specify dependencies between transformations using profiles • Setting up a UML based framework to configure component platforms in a platform independent way (currently for Draco and CCM) • Modeling real time aspects in UML using profiles (future work)
Conclusions • MDA is • Rising the level of abstraction • Specific (modeling) languages • Seperating business knowledge fromimplementation technology • Applying automatic transformations • Managing the metadata centrally • Is MDA ready? • Still work in progress • But... We can use some parts • UML+profiles • Limited code generation