ALT

1,394 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,394
On SlideShare
0
From Embeds
0
Number of Embeds
51
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • ALT

    1. 1. From Principles to Implementation: Some Lessons Learned in the Building of the AMMA Model Engineering Platform Jean Bézivin Jean.Bezivin{noSpamAt}univ-nantes.fr ATLAS Group (INRIA & LINA), University of Nantes, France http://www.sciences.univ-nantes.fr/lina/atl/
    2. 2. Model Driven Engineering <ul><li>Schedule </li></ul><ul><ul><li>Scope & Applicability </li></ul></ul><ul><ul><li>Principles </li></ul></ul><ul><ul><li>Deployment (AMMA) </li></ul></ul><ul><li>Credits </li></ul><ul><ul><li>Modelware </li></ul></ul><ul><ul><li>Microsoft </li></ul></ul><ul><ul><li>IBM </li></ul></ul><ul><ul><li>TNI </li></ul></ul><ul><ul><li>Sodifrance </li></ul></ul>
    3. 3. Basic entities System Model repOf System : a group of interacting, interrelated, or interdependent elements forming a complex whole. Model : an abstract representation of a system created for a specific purpose. Technical Space : a representation system for models and a set of technical solutions to handle them. Technical Space
    4. 4. The playground Principles Standards Tools Teaching sNets, 1990 UML, 1995 today, AMMA MOF, 2000 tomorrow
    5. 5. Principles, standards and tools Principles Standards Tools Model-Driven Engineering (MDE) MDA™ Model-Driven Architecture (OMG) Eclipse EMF GMF MIC Model Integrated Computing GME Software Factories (MS) Microsoft Visual Studio Team system DSL Tools Other Standards Other Tools
    6. 6. IBM on MDA : Three complementary ideas <ul><li>Direct representation </li></ul><ul><li>Automation </li></ul><ul><li>Standards </li></ul>Direct representation => multiple languages Danger of fragmentation Need coordination How to coordinate? Short answer: metametamodel But what is a metametamodel?
    7. 7. Agenda <ul><li>Scope </li></ul>
    8. 8. Introduction <ul><li>The industrial evolution (OMG MDA™, IBM EMF, Microsoft Software Factories) and the MDE trend </li></ul><ul><li>The need for sound principles (models as first class entities) </li></ul><ul><li>Technical spaces or why MDE is not sufficient. Multiple Technical Spaces inside MDE </li></ul>EMF?
    9. 9. The initial move: from Middleware to Modelware
    10. 10. Latest tentative to define MDA
    11. 11. Steve Cook (OOPSLA 2004 panel) <ul><li>Suggests that MDA proponents fall into the following three camps: </li></ul><ul><ul><li>The UML PIM camp: MDA involves the use of UML to build Platform Independent Models (PIMs) which are transformed into Platform Specific Models (PSMs) from which code is generated. </li></ul></ul><ul><ul><li>The MOF camp: MDA does not involve the use of UML, but instead the crucial technology is MOF, and the definition of modelling languages and language transformations using MOF. </li></ul></ul><ul><ul><li>The Executable UML camp: MDA involves building a UML compiler, making it a first class programming language. </li></ul></ul>Ref: Steve Cook Blog @: http://blogs.msdn.com/stevecook
    12. 12. MDA in a nutshell : PSM = f(PIM) - One unique Metametamodel (the MOF) - An important library of compatible Metamodels, each defining a DSL - Each of the models is defined in the language of its unique metamodel M 1 M 2 M 3
    13. 13. The initial MDA conjecture : PSM = f(PIM) PIMs (Platform Independent Models) PSMs (Platform Specific Models) Merging phase PDMs (Platform Description Models) ? weaving PSM branch PDM branch PIM branch M
    14. 14. Two missing links in the OMG architecture PSM = f(PIM, PDM) or after currying: PSM = f PDM (PIM) PIM P D M P S M “ numeric” values: PDM = DotNet PDM = EJB
    15. 15. Microsoft Software Factories <ul><li>SDK (Team System) released in late 2004 </li></ul><ul><ul><li>First presentation at OOPSLA, Vancouver, Oct. 2004 </li></ul></ul><ul><ul><li>See S. Cook, S. Kent, J. Greenfield and K. Short Blogs </li></ul></ul><ul><li>Aims to be closer to a metaCASE tool than Eclipse </li></ul><ul><ul><li>(however follow GMF Borland) </li></ul></ul><ul><li>Not UML-based (nor MOF, nor XMI) </li></ul><ul><li>Models strongly tied to code </li></ul><ul><ul><li>Reverse engineering/synchronization </li></ul></ul><ul><ul><li>Reliance on Microsoft’s platforms (Visual studio) </li></ul></ul><ul><li>… Modeling is the future … </li></ul><ul><ul><li>Bill Gates </li></ul></ul>
    16. 16. MDE@Microsoft <ul><li>Microsoft is releasing a suite of tools to make it easy to construct graphical designers hosted in Visual Studio for editing domain specific languages (DSL). </li></ul>
    17. 17. Creating a Petri net DSL Metamodel: a couple of logical and visual definitions
    18. 18. Creating a Petri net DSL <ul><li>Mapping on DotNet standard tools (C#, CLS, CLR, etc.) </li></ul><ul><li>We are far from the initial OMG PIM/PSM naive separation </li></ul><ul><li>However this is really MDE in 2005 </li></ul>
    19. 19. A first attempt to reverse engineer the DSL Metametamodel
    20. 20. Microsoft DSI (Dynamic System Initiative) March 2005 <ul><li>A system model captures an entire system's composition in terms of all interrelated software and hardware components. </li></ul><ul><li>A system model captures knowledge as prescriptive configurations and best practices, allowing the effects of changes to the system to be tested before the changes are implemented. </li></ul><ul><li>Administrators do not need to operate directly on real-world systems but rather can model changes before committing to them. In this way, “what if” scenarios can be tried without impact to a business. </li></ul><ul><li>A system model becomes the point of coordination and consistency across administrators who have separate but interdependent responsibilities. </li></ul>System Definition Model is a language, or a meta-model, that is used to create models of distributed systems. A distributed system is a set of related software or software and hardware resources running on one or more computers that are working together to accomplish a common function
    21. 21. The notion of TS (Technology Space) as a tool for collaboration <ul><li>A Technology Space corresponds to : </li></ul><ul><ul><li>A uniform representation system </li></ul></ul><ul><ul><ul><li>Syntactic trees </li></ul></ul></ul><ul><ul><ul><li>XML trees </li></ul></ul></ul><ul><ul><ul><li>Sowa graphs </li></ul></ul></ul><ul><ul><ul><li>UML graphs </li></ul></ul></ul><ul><ul><ul><li>MOF graphs </li></ul></ul></ul><ul><ul><ul><li>Categories </li></ul></ul></ul><ul><ul><ul><li>Graph Grammars </li></ul></ul></ul><ul><ul><li>A working context </li></ul></ul><ul><ul><li>A set of concepts </li></ul></ul><ul><ul><li>A shared knowledge and know how </li></ul></ul><ul><ul><li>etc. </li></ul></ul><ul><li>It is usually related to a given community with an established expertise, know-how and research problems </li></ul><ul><li>It has a set of associated tools and practices, etc. </li></ul><ul><ul><li>Protégé, Rational Rose, … </li></ul></ul>XML documentware MDA Modelware Corba C++ WWW etc. RDBMS Corba Ontologies Java Graph Theory OOBMS Linux Description logic Prolog Semantic WEB Grammarware
    22. 22. Abstract Syntax Systems Compared MOF The UML meta-Model A Specific UML Model A Specific phenomenon corresponding to a UML Model EBNF Pascal Language Grammar A specific Pascal Program A specific execution of a Pascal program Technology #2 (MOF + OCL) M 3 M 2 M 1 Technology #1 (formal grammars attribute grammars, etc.) etc .
    23. 23. A technical space is organized around a set of concepts TSpaces may be connected via bridges TSpaces are often similarly organized But also… Program Grammar Data Schema Model Meta-Model Document Schema Ontology Top Level O. Syntax XML MDA DBMS Ontology engineering File FileFormat Drawing Stencil Model Meta-Model ToolFormat Tool Content Form FSMngt XML MDA Visio InfoPath
    24. 24. Technical Spaces and Working Contexts <ul><li>Technical Spaces </li></ul><ul><ul><li>Examples: MDE, MDA, MS/SF, EBNF, XML, DBMS, ontologies, etc. </li></ul></ul><ul><ul><li>Conjecture: </li></ul></ul><ul><ul><ul><li>Each TS is represented by a metametamodel </li></ul></ul></ul><ul><ul><ul><li>Each TS is organized in a 3 metalevel architecture </li></ul></ul></ul><ul><li>Working contexts </li></ul><ul><ul><li>Local </li></ul></ul><ul><ul><ul><li>MM specific </li></ul></ul></ul><ul><ul><li>Global </li></ul></ul><ul><ul><ul><li>TS specific, MM independent </li></ul></ul></ul><ul><ul><li>Universal </li></ul></ul><ul><ul><ul><li>Across several TSs (extended MIME notation) </li></ul></ul></ul><ul><ul><ul><ul><li>Mof1.4/UML/mymodel </li></ul></ul></ul></ul><ul><ul><ul><ul><li>MicrosoftDSL/PetriNet/MyNet </li></ul></ul></ul></ul><ul><ul><ul><ul><li>ECORE/PetriNet/MyNet </li></ul></ul></ul></ul><ul><ul><ul><ul><li>EBNF/Pascal/MyProg </li></ul></ul></ul></ul><ul><ul><ul><ul><li>XML/MusicML/MyMusic </li></ul></ul></ul></ul><ul><ul><ul><ul><li>M3/M2/M1 </li></ul></ul></ul></ul>
    25. 25. Models revisited <ul><li>Everything is a model </li></ul><ul><ul><li>A  -model </li></ul></ul><ul><ul><li> meaning any specific TSpace </li></ul></ul><ul><ul><li>An XML document is an XML-model </li></ul></ul><ul><ul><li>A Java source program is a Java-model </li></ul></ul><ul><ul><li>An UML model is a MDA-model </li></ul></ul><ul><ul><li>etc. </li></ul></ul><ul><li>Each TSpace is rooted in a metametamodel (M3) defining a representation scheme and basic type system. </li></ul><ul><li>Distinguish between intra-space and inter-space operations </li></ul>
    26. 26. Model transformation across Technical Spaces <ul><li>There is a need for inter-TS model transformation. </li></ul>A TS B TS C TS D TS
    27. 27. Agenda <ul><li>Applicability </li></ul>
    28. 28. Some examples of transformations <ul><li>Classical </li></ul><ul><ul><li>UML2Java </li></ul></ul><ul><ul><li>UML2RDBMS </li></ul></ul><ul><li>But also tool to tool (more important) </li></ul><ul><ul><li>UML Activity Diagrams to MS Project </li></ul></ul>
    29. 29. The KM3 metamodel (simplified)
    30. 30. KM3 definition of the KM3 metamodel <ul><li>package KM3 { </li></ul><ul><li>abstract class ModelElement extends LocatedElement { </li></ul><ul><li>attribute name : String; </li></ul><ul><li>reference &quot;package&quot; : Package oppositeOf contents; </li></ul><ul><li>} </li></ul><ul><li>class Package extends ModelElement { </li></ul><ul><li>reference contents[*] ordered container : ModelElement oppositeOf &quot;package&quot;; </li></ul><ul><li>} </li></ul><ul><li>class Classifier extends ModelElement {} </li></ul><ul><li>class DataType extends Classifier {} </li></ul><ul><li>class Class extends Classifier { </li></ul><ul><li>attribute isAbstract : Boolean; </li></ul><ul><li>reference supertypes[*] : Class; </li></ul><ul><li>reference structuralFeatures[*] ordered container : StructuralFeature </li></ul><ul><li> oppositeOf owner; </li></ul><ul><li>} </li></ul><ul><li>-- continued on next slide </li></ul>NOT XMI (Emfatic-like)
    31. 31. Java to Excel Transformation (call graph) public class SecondClass { public void sc_m1(){ FirstClass a = new FirstClass(); a.fc_m1(); } public void sc_m2(){ this.sc_m1(); } } public class FirstClass { public void fc_m1(){ } public void fc_m2(){ this.fc_m1(); this.fc_m1(); } } SecondClasss.java FirstClass.java
    32. 32. Java and Table Metamodels
    33. 33. UMLDI2SVG
    34. 34. Tool Interoperability <ul><li>Tool interoperability </li></ul><ul><li>Build a metamodel of each tool </li></ul><ul><li>Write a transformation </li></ul><ul><li>Two kinds of Metamodels </li></ul><ul><li>Data stream oriented </li></ul><ul><li>Event oriented </li></ul>AMMA ATL AMW AM3 ATP Tool X Tool Y
    35. 35. Agenda <ul><li>Principles </li></ul>
    36. 36. What about the stability of MDA? <ul><li>Missing foundations may cause big problems ahead </li></ul>
    37. 37. Just an academic issue anyway?
    38. 38. Enter the &quot;metamuddle&quot;
    39. 39. Model of a model
    40. 40. The MDA metamuddle <ul><li>A very rapidly growing industrial application field since november 2000, </li></ul><ul><li>… but … </li></ul><ul><li>We badly need a unifying theory of models </li></ul>
    41. 41. Credits and MDA compliance Ontology engineering MDE Language engineering
    42. 42. The &quot;representation&quot; relation repOf System and System elements Model and Model elements Simple set interpretation of the repOf relation is probably as correct as simple set interpretation of the instanceOf relation in object technology. ?
    43. 43. The &quot;conformance&quot; relation M 2 M 1 the MOF Class Association source destination M 3 c2 c2 c2 meta meta meta meta meta meta meta the UML MetaModel Class Attribute * 1 a UML Model Client Name : String metamodel model &quot;the real world&quot; meta-meta model The MOF The UML metamodel Some UML Models Various usages of these models M 0 M 1 M 2 M 3
    44. 44. Summary: a Petri Net model arcPT arcTP outGo outGo inCom inCom outGo inCom inCom outGo outGo inCom conformsTo conformsTo conformsTo repOf System P2 P1 T1 Classical representation M1 M2 M3 Metametamodel Metamodel Model Node Place Place P1 Place P2 Node Trans Node Node Node Link Link arcPT Link arcTP Trans T1 Link inCom Link outGo Link meta meta
    45. 45. <petrinet> <place name=“P1”/> <place name=“P2”/> <transition name=“T1”/> <arcPT source=“P1” target=“T1”/> <arcTP source=“T1” target=“P2/> </petrinet> conformsTo conformsTo repOf System … <xs:element name=“place&quot;> <xs:complexType> <xs:attribute name=“name“ type=“xs:string&quot;/> </xs:complexType> </xs:element> … … <xs:element name=“element&quot;> <xs:complexType> <xs:attribute name=“name“ type=“xs:string&quot;/> … </xs:complexType> </xs:element> … conformsTo P2 P1 T1 Classical representation M1 M2 M3 Metametamodel: XML Schema for XML Schema Metamodel: a Petri Net XML Schema Model: an XML document meta
    46. 46. Agenda <ul><li>Deployment </li></ul>
    47. 47. AMMA: A Lightweight Architectural Style for for Generic Model Management Platforms <ul><li>ATLAS Model Management Architecture </li></ul><ul><li>Build around a minimal set of sound principles </li></ul><ul><li>Defines the conventions for the various connected tools to interoperate </li></ul><ul><li>Lightweight : Not reinventing CORBA (Model-based interoperability and not Middelware-based interoperability) </li></ul><ul><li>Four basic blocks: </li></ul>AMMA ATL AMW AM3 ATP M. Transformation M. Composition M. Global Management Inter TSpaces Bridge
    48. 48. Atlas Model Management Architecture <ul><li>Modeling in the small </li></ul><ul><ul><li>Working at the level of model and metamodel elements </li></ul></ul><ul><li>Modeling in the large </li></ul><ul><ul><li>Working with models and metamodels as global entities , for what they represent, and their mutual relations, independently of their content </li></ul></ul><ul><ul><li>A megamodel is a model which elements represents models, metamodels and other global entities (ako model registry with metadata on models and metamodels). A megamodel has a metamodel. </li></ul></ul>
    49. 49. ATL: a model transformation language, engine and IDE <ul><li>ATL: a MOF/QVT like model transformation language </li></ul><ul><li>For more info see: http://www.sciences.univ-nantes.fr/lina/atl/ </li></ul>
    50. 50. Model Transformation with ATL conformsTo conformsTo conformsTo conformsTo conformsTo G 2 P Rule R 2 B Rule Ma Mb MMa Green Node Red Node MMb Blue Node Pink Node Metametamodel Node Node ATL Rule Node MMa2MMb.atl
    51. 51. ATL editor (part of ATL Integrated Development Environment)
    52. 52. ATL Development Tools: source-level debugger
    53. 53. The standard OMG model transformation language ATL is a QVT-like language If QVT is the solution, then what was the problem?
    54. 54. The Model Weaver : principles OperationPort mapsTo OperationType Left MM Weaving MM Right MM Stub MM Weaving model extends c2 - Fixed mapping metamodel s are not sufficient - We need su p port for extensible variable metamodels
    55. 55. <ul><li>Model </li></ul><ul><ul><li>set of elements and associations </li></ul></ul><ul><ul><ul><li>Associations (intra model relationships) </li></ul></ul></ul><ul><ul><li>Model Composition (inter model relationships) </li></ul></ul>Models E1 hasA references E2 E3 Model E1 E2 E3 Model 1 E1 E2 Model 2 isA E3 E4 isA E4 inherits Semantic defined in the metamodel Undefined line semantics
    56. 56. Metamodel extensions <ul><li>Several possible mapping DSLs (Domain Specific Languages) </li></ul><ul><li>Adding extra semantics </li></ul><ul><ul><li>Concatenation, foreign keys, nested, ordered, equals, containment, </li></ul></ul><ul><ul><li>supplier/consumer, etc. </li></ul></ul>E1 E2 E2 Model 1 E1 E2 Model 2 E3 E4 Equals Concat String
    57. 57. AMW example: RDBMS to XML Semantics SQL schema represented in Ecore XML schema represented in Ecore
    58. 58. Weaving metamodel Visualization (DSL tools and EMF)
    59. 59. Weaving metamodel <ul><li>Minimal weaving metamodel </li></ul><ul><ul><li>links and correspondences </li></ul></ul><ul><ul><li>extended to be used in different applications </li></ul></ul>
    60. 60. AM3: ATLAS MegaModel Management Tool <ul><li>Megamodel: a model with elements corresponding to models, metamodels, services, tools and more generally to any global resource available in the scope of an AMMA session. </li></ul><ul><li>A registry for model engineering resources as well as a metadata repository </li></ul><ul><li>Megamodel with different metamodels </li></ul><ul><li>Megamodels beyond typing systems </li></ul>MM M typeOf MM’ versionOf MM’ extensionOf Tool Service implements Parameter typeOf input output T M output intput etc.
    61. 61. Representing zones with Megamodels ZoneA Megamodel MgA repOf Megamodel Metamodel c2 ZoneB Megamodel MgB repOf c2 Fred ATL Nantes Ivan Mistral Enschede
    62. 62. Representing zones with Megamodels ZoneA Megamodel MgA repOf ZoneB Megamodel MgB  MgC repOf ZoneC Megamodel Metamodel c2 c2 ZoneBC
    63. 63. Initial Metamodel Proposal for AMMA Megamodel Components
    64. 64. Megamodel Resource Navigator for model components <ul><li>Technology Preview </li></ul>
    65. 65. ATP: TS and projectors TSpace #1 MDA TSpace #2 EBNF TSpace #3 XML TSpace #4 SQL π 1 π 3 π 2 Java Corba SVG NLP, etc. XMI JMI CMI etc. ATLAS Technical Projectors MS/Office Simulink Matlab etc. model mmodel grammar program document XMLschema dataSchema data
    66. 66. Examples of projections from ME to XML and EBNF TSs XML TS ME TS EBNF TS MOF MMa Ma EBNF KM3.g MMa.km3 XSD MMa.xsd Ma.xmi XMI KM3 M3 M2 M1
    67. 67. Conclusions <ul><li>Transformations are models </li></ul><ul><li>Weavings (correspondences) are models </li></ul><ul><li>Megamodels are models </li></ul><ul><li>(meta-)Models everywhere </li></ul><ul><ul><li>A file format </li></ul></ul><ul><ul><li>A tool internal data </li></ul></ul><ul><ul><li>A Visio stencil </li></ul></ul><ul><ul><li>An Infopath Form </li></ul></ul><ul><ul><li>An API </li></ul></ul><ul><ul><li>etc. </li></ul></ul><ul><li>Pragmatics of model transformation are important </li></ul><ul><li>EMF and MS/DSL may be considered as two TSpaces, based on different M3 </li></ul>
    68. 68. Conclusions: AMMA on top of Eclipse and MS/DSL tools ATL MTF KM3 Emfatic etc. etc. Eclipse EMF AMMA Visual Studio Team System AMMA
    69. 69. How adaptable is MDA? <ul><li>MDA™ already evolved a lot in the last five years. </li></ul><ul><li>MDA will have to evolve much more rapidly in the near future if OMG wants to meet the real needs of the user community. </li></ul><ul><li>Strong competition will be coming from other technical spaces like XML, Microsoft DSLs, EMF, etc. </li></ul><ul><li>End users are no more accepting huge, approximatively defined and committee-driven standards; they are asking for an available, adapted and agile set of small standards similar to XML. </li></ul><ul><li>If MDA does not evolve rapidly, it will become one small niche in the MDE landscape; it will be quoted as the first historical one; many competing families of model engineering technologies will emerge and develop. </li></ul><ul><li>What is important is assessing the basic principles of MDE; The decisions of OMG, W3C, OASIS, Microsoft, IBM and others on how to map these principles on implementation frameworks (e.g. Java, C#, XML, etc.) or on paper recommendations is only the responsibility of these organizations; the end user will be the final judge. </li></ul>
    70. 70. Thanks <ul><ul><li>Questions? </li></ul></ul><ul><ul><li>Comments? </li></ul></ul>http://www.sciences.univ-nantes.fr/lina/atl/

    ×