SlideShare a Scribd company logo
1 of 41
Introducing
   Model Driven
   Software Development
                  Pedro J. Molina, PhD.
                              Software Engineer
                Capgemini Spain | Valencia
                             pjmolina@gmail.com
                   http://pjmolina.com/metalevel
Contents
   Objective
   What’s MDSD?
   Why are we doing it?
   How we can apply it?
   CG2011 Program review




                            2
Setting expectations
       What to expect from CG2011?
          The Europe leading conf. about Code
           Generation
          Focused on practical tools and industrial
           experiences
          A place to find and discuss with the Tool
           Makers
          Probably one of the best places to learn
           and share knowledge about Code
           Generation

       My objective with this session
          Provide an overview to Code Generation
          Provide clues to newcomers to select
           your own path in the conference


                                                  3
Motivation: Programmers needed!
 The impossible equation (Jean Bézivin)
    1.       Slow increase of professionals
                Same trend in next 25 years


    2.       Rapid increase of SW to be developped

    3.       No way to cope with it

    4.       End User Programming
                Example: Visical, Excel
                By DSL, abstraction
                Custom languages


    http://mymodelingblog.blogspot.com/2009/08/impossible-equation.html




                                                                          4
Abstraction Levels
                                                        The entire history of software engineering is
               Application                              one of rising levels of abstraction (abstraction
                Domain                                  is the primary way we as humans deal with
                                                        complexity).
                                                                                          Grady Booch


                             Models / Specs
Semantic Gap




                                              4GL




                                                                                                    Abstraction level
                                              COBOL / C / Basic / Java


                                                                Assembler


                                                                     Machine Code


                                                                                                   5
What’s a Domain?
          Real Time                              Management
           Systems                                Systems


        Air Traffic           Luggage
                                                     Insurance
         Control              Tracking
                                                      Systems
         Systems              Systems



   Focused on strict time                  Focused on structure, data
    constrains and tracking                  and transactions




                                                                          6
What’s a Language?
                                                    Declarative
       C(x)                 h2      2C(x)
    ih       = –
        t      2m                     x2
  a>b && c==d              John cookies        24   green
                           Phil      fish      32   blue

<CallRecord>
 <caller><number>07713248</number>


Textual                                             Employee
                                                      Name
                                                                       Position
                                                                      Description    Graphical
                                                     Address   0..*
                                                                        Salary
                                                     Promote           Assign


class Invoice: Document                                                             Record       Cost min.

{                                                                                                        
    public void Bill()                                                                        Duration

                                                    Imperative               Call        DB



                                                                                                    7
What’s a model?
 A model allows
    the description of a family of problems for a domain
    Having the abstraction level carefully selected to:
       Discard irrelevant details (reduce complexity)
                                                                     Source
       Discard constant details (reduce complexity)
       Explicit important details (variables part)      Class                 Relation

                                                             Properties          Cardinality
 What’s a meta-model?                                                Target
   A model describing model.

                                             Customer                           Credit Card
                                                         1                *



                                                                                          8
Some Acronyms
 MD* (MDD = MDE = MDSD  MDA)        MDSD
 MDSD = Model-Driven Software
  Development
                                    MDA   DSLs
 MDD = Model Driven Development
 MDE = Model Driven Engineering
 MDA = Model Driven Architecture
 OMG = Object Management Group

 DSL = Domain Specific Language
 AST = Abstract Syntactic Tree


                                                 9
MDD
      Model Driven Development

    Definition:
       The usage of Models as the main artefacts
       to Drive the software Development.




                                               10
Code Generation
                   Model     Code      Assets
                           Generator




Definition:
The automated synthesis of SW assets like
source code, documentation or models using
models as input.



                                                11
Novak’s rule
“Automatic Programming is defined as the
  synthesis of a program from an specification.

  If automatic programming is to be useful, the
  specification must be smaller and easier to
  write than the program would be if written in
  a conventional programming language.”

                                     G.S. Novak

                                                  12
Commonality / Variability
 Family of programs
  (D. Parnas)

   Common part
      Standard, Fixed.
      Implementable in common & shared base libraries

   Variable part
      Specify in the model
      Generable

                                                         13
Separation of Concerns (SoC)
Know-How captured in two separated buckets:
What                                How
 Business Know-How:                 Technological Know-How:
  captured in form of models          captured & encapsulated in form of
  (specifications): isolated from     best practices, frameworks,
  technological issues                templates & code patterns in code
                                      generators & interpreters.




                                                                      14
ROI

 Economies of Scale
 Economies of Scope
 Economics of MDSD

 Development Life Cycle Impact
 Quality



                             15
Economies of Scale
 Economies of Scale
    The condition where few inputs, as effort and time, are needed to
     produce big quantities of a unique output. [Wit96]




                                                             But: Can’t be applied to SW!
                                                             Once the SW is produced
                                                             Copy cost is = 0 £!




                 Japanese Cookie Factory. Production Line.



                                                                                       16
17
Economies of Scope
 Economies of Scope
   The condition where few inputs, as effort and time, are
    needed to produce a great variety of outputs. It is
    produced more added value producing in the same line
    different outputs. To produce each output independently
    creates an overcost in the common parts.

   Economy of Scope occurs when the cost of combining two
    or more products in a unique product line is lower than
    producing them independently. [Wit96]




                                                              18
MDSD: Economic Model
                               Investment
  Domain Engineering


                                 Feedback:
                                         Clients suggestions
Application Development                  Improvements for the
      Environment                         development environment




 Application Engineering




                           ROI (development cost saving)
      Applications


                                                              19
MDSD: Economic Model
                   Traditional Cost =       N * CT
                   MDD cost          = Inv + N * CF
                                                                            Saving AF = CT - CF

                    5 CT

                    4 CT
Accumulated costs




                    3 CT


                    2 CT
                                Inv

                      CT


                                         1         2   3        4       5
                                                       Family members
                                                                                        20
SW Life-cycle Impact
 More time in analysis and
  design tasks
 Less time in coding

 Less defect, more Quality
 Improved productivity
    Order of magnitude

 Continuous Integration
 Agile development cycles
 Less cost
                                 21
Defects Cost and Distribution
                            Traditional life cycle
                            MDD life cycle                   Exponential cost
% Defects                                               8€
                                                             of defects




                                                4€



                            2€

                   1€



                Analysis   Design            Coding   Maintenance

                            Snow ball effect
                                                                       22
Models: some Cases of Use
1. Validation   2. Interpretation   3. Code Generation

  Model             Model                Model




  Model                                 Code
                 Interpreter
 Checker                              Generation

                    Runtime                               Code
                 interpretation
                                                         Metadata

                                       Generated            Doc
  Report
                                         Code               Config.
                                                             Tests
                                                                 ...
                                                                       23
Conceptual Map for Code
                            Generation
Types




               Metamodel                           Templates
                              Transformations

                             Code Generator
Instances




                     Model                           Code



            Higher             Abstraction Level               Lower


                                                                       24
UML/MDA
 UML: Unified Modelling Language
   Origins: unified notation (from three
    sources, The Three Amigos)
   OCL: constraint language
   Great acceptation, common language
    for software engineering

 MDA: Model Driven Architecture
     MDA = MDSD with UML
     Proposed by OMG
     Profiles
     PIM/PSM
     MOF/XMI


                                            25
Code Generation with UML tools
Types




                      Metamodel                        Templates
                                  Transformations
Instances




                       Model                             Code



             Higher                Abstraction Level               Lower


                                                                           26
Code Generation with UML/MDA
 Usage of UML Models
 Extension mechanism:                       «persistent»
                                              Customer
   Stereotypes
   Profiles for specialized domains   «pk» string Id
                                       «derived» double Balance

 Good enough for:
   Structure: class and properties
   State transition diagrams
    (frequent in embedded systems)


                                                                  27
Code Generation with UML/MDA
 As rich/poor enough as you can express and maintain in UML
 “Only a 20% of UML is generally needed for SW development.” Ivar Jacobson
    But: What percent of my problem can such 20% of UML solve?

 Metamodel is highly closed
     Only extensible at certain points

 Shortcomings
    Symbol and concept overloading
    Not clear Semantics
    Action Language
    Domains not cover by UML: e.g. User Interfaces
    Abuse of profiles  Forces models and semantics (One size doesn’t fit
     all)
    Tools: many dialects of XMI  Babel’s Tower


                                                                         28
DSL
 A DSL approach to MDSD gives you
  full control on the development of
  your metamodel
    Powerful
    Better well suited to your needs
    “Do it yourself” approach

 Tools to be built
    Metamodels, editors, model checkers,
     compilers, code generators

                                        29
DSL
 Internal DSL: Sample LINQ
   var studentPassList = from student in students
                         where student.Score > 500
                         select student;



 External DSL: Sample SQL

   SELECT Name, Surname FROM STUDENT
          WHERE Score > 500;


                                                     30
Code Generation with EMF
Types




               EMF Metamodel                          Templates
                                 Transformations
Instances




                     EMF Model                          Code



            Higher                Abstraction Level               Lower


                                                                          31
Code Generation with MS DSL Tools
Types




                DSL Metamodel                               T4 Templates
                                                 Transformations
Instances




                      DSL Model                                    Code



             Higher               Abstraction Level                        Lower


                                                                                   32
Code generation techniques
1. Parse model                          Input Model



2. In-memory representation
                                             Template
   AST / Object Model        AST



3. Output building
   Free text concatenation
   XSL-T (ouch!)
   Text Template based
                                    Output code

                                                  33
Tools matters
                           Metamodel(s)
                                                          Reverse
Textual Model Editor
                                                        Engineering
                                                           Tools
Visual Model Editor
                                 Model(s)
  Model Checker

        IDE


                         Model Transformation

                         M2M                 M2T



                                             Code
                         Model
                                            Doc, etc.
                                                                34
Who are working in the area?
 Eclipse EMF/GMF        Microsoft
    IBM                     DSL Tools
    SAP                 MetaCase
    Obeo                    MetaEdit+

 Xtext                  JetBrains
    Itemis                  MPS

                         Intentional Software
 xUML / MDA                 Intentional Workbench
      Kennedy Carter
      Blue Age          WebRatio
      Artisan           Mendix
      AndroMDA          Many more
      Olivanova             …

                                      Presenting at CG2011 or LWC2011

                                                                   35
Language Workbenches
                          Competition 2011
                                  Tool                             Presenter
                                  MPS                              Markus Völter
                                  MetaEdit+                        Steven Kelly
                                  OOMEGA                           Christian Merenda
                                  Whole Platform                   Riccardo Solmi
                                  Rascal                           Jurgen Vinju
                                  Spoofax                          Lennart Kats
                                  Intentional                      Mats Helander
                                  Essential                        Pedro J. Molina
                                  Obeo Designer                    Mariot Chauvin
                                  Xtext                            Karsten Thoms
                                  Session Chair: Angelo Hulshout


Language Workbench: http://martinfowler.com/articles/languageWorkbench.html [Fowler2005]



                                                                                           36
Programme Guide
          Keynotes

            Terence Parr
                ANTLR
                StringTemplate


                        Thursday 26th 9:00 H


            Ed Merks
                Eclipse Modeling
                 Framework leader

                          Friday 27th 9:00 H



                                         37
Programme Guide
      Experience reports
         Lesson from real MDSD applications


      Tool tutorials and Hand on Labs
         Learn to use them


      Panels and Goldfish bowl
         Promote debate and participation
          about a reference topic


      Birds of a Feather
         Formation of informal interest groups
          on the fly                        38
CG2011 Tips
 Choose your path
     Parallel tracks
     Split your team
     Check for slides of missing session on the conference
      web, SlideShare or InfoQ.com

 Interact!
       Tweet about it using the tag #cg2011
       Install the CG2011 iPhone App
       Introduce yourself and involve in the community
       Ask whenever something is not clear to you
       Ask for each dark acronym you find
       Do not miss the traditional and relaxing punting trip!
       Continue the discussion on the social network:
        http://modeldrivensoftware.net/




                                                                 39
Conclusions
 A change in SW development is needed

 MDSD :
    Provide leverage points to reach new levels of productivity

    Offer a clear path to make better engineering in Computer
     Science




                                                                   40
Thank you!




Questions?
               @pmolinam

More Related Content

Viewers also liked

The Unbearable Stupidity of Modeling
The Unbearable Stupidity of ModelingThe Unbearable Stupidity of Modeling
The Unbearable Stupidity of ModelingPeter Friese
 
EMF Compare 2.0: Scaling to Millions (updated)
EMF Compare 2.0: Scaling to Millions (updated)EMF Compare 2.0: Scaling to Millions (updated)
EMF Compare 2.0: Scaling to Millions (updated)mikaelbarbero
 
MoDisco EclipseCon2010
MoDisco EclipseCon2010MoDisco EclipseCon2010
MoDisco EclipseCon2010fmadiot
 
You need to extend your models? EMF Facet vs. EMF Profiles
You need to extend your models? EMF Facet vs. EMF ProfilesYou need to extend your models? EMF Facet vs. EMF Profiles
You need to extend your models? EMF Facet vs. EMF ProfilesPhilip Langer
 
Industrial and Academic Experiences with a User Interaction Modeling Language...
Industrial and Academic Experiences with a User Interaction Modeling Language...Industrial and Academic Experiences with a User Interaction Modeling Language...
Industrial and Academic Experiences with a User Interaction Modeling Language...Marco Brambilla
 
IFML - The interaction flow modeling language, the OMG standard for UI modeli...
IFML - The interaction flow modeling language, the OMG standard for UI modeli...IFML - The interaction flow modeling language, the OMG standard for UI modeli...
IFML - The interaction flow modeling language, the OMG standard for UI modeli...Marco Brambilla
 
Textual Modeling Framework Xtext
Textual Modeling Framework XtextTextual Modeling Framework Xtext
Textual Modeling Framework XtextSebastian Zarnekow
 
Programming in UML: An Introduction to fUML and Alf
Programming in UML: An Introduction to fUML and AlfProgramming in UML: An Introduction to fUML and Alf
Programming in UML: An Introduction to fUML and AlfEd Seidewitz
 
ATL tutorial - EclipseCon 2008
ATL tutorial - EclipseCon 2008ATL tutorial - EclipseCon 2008
ATL tutorial - EclipseCon 2008William Piers
 
Mes 分析 第四週
Mes 分析 第四週Mes 分析 第四週
Mes 分析 第四週信宏 陳
 
Mes 分析 第二週
Mes 分析 第二週Mes 分析 第二週
Mes 分析 第二週信宏 陳
 
Eclipse World 2007: Fundamentals of the Eclipse Modeling Framework
Eclipse World 2007: Fundamentals of the Eclipse Modeling FrameworkEclipse World 2007: Fundamentals of the Eclipse Modeling Framework
Eclipse World 2007: Fundamentals of the Eclipse Modeling FrameworkDave Steinberg
 
大資料分析技術的濫觴
大資料分析技術的濫觴大資料分析技術的濫觴
大資料分析技術的濫觴家雋 莊
 
Java Style Grading
Java Style Grading Java Style Grading
Java Style Grading Natã Melo
 
Animated transitions across UI views
Animated transitions across UI viewsAnimated transitions across UI views
Animated transitions across UI viewsVivian Motti
 
Minicurso grails
Minicurso grailsMinicurso grails
Minicurso grailsNatã Melo
 
MATRACA: Ferramenta open source para auxílio a deficientes visuais no uso do ...
MATRACA: Ferramenta open source para auxílio a deficientes visuais no uso do ...MATRACA: Ferramenta open source para auxílio a deficientes visuais no uso do ...
MATRACA: Ferramenta open source para auxílio a deficientes visuais no uso do ...Natã Melo
 

Viewers also liked (20)

The Unbearable Stupidity of Modeling
The Unbearable Stupidity of ModelingThe Unbearable Stupidity of Modeling
The Unbearable Stupidity of Modeling
 
EMF Compare 2.0: Scaling to Millions (updated)
EMF Compare 2.0: Scaling to Millions (updated)EMF Compare 2.0: Scaling to Millions (updated)
EMF Compare 2.0: Scaling to Millions (updated)
 
MoDisco EclipseCon2010
MoDisco EclipseCon2010MoDisco EclipseCon2010
MoDisco EclipseCon2010
 
OCL tutorial
OCL tutorial OCL tutorial
OCL tutorial
 
You need to extend your models? EMF Facet vs. EMF Profiles
You need to extend your models? EMF Facet vs. EMF ProfilesYou need to extend your models? EMF Facet vs. EMF Profiles
You need to extend your models? EMF Facet vs. EMF Profiles
 
Industrial and Academic Experiences with a User Interaction Modeling Language...
Industrial and Academic Experiences with a User Interaction Modeling Language...Industrial and Academic Experiences with a User Interaction Modeling Language...
Industrial and Academic Experiences with a User Interaction Modeling Language...
 
IFML - The interaction flow modeling language, the OMG standard for UI modeli...
IFML - The interaction flow modeling language, the OMG standard for UI modeli...IFML - The interaction flow modeling language, the OMG standard for UI modeli...
IFML - The interaction flow modeling language, the OMG standard for UI modeli...
 
Textual Modeling Framework Xtext
Textual Modeling Framework XtextTextual Modeling Framework Xtext
Textual Modeling Framework Xtext
 
Programming in UML: An Introduction to fUML and Alf
Programming in UML: An Introduction to fUML and AlfProgramming in UML: An Introduction to fUML and Alf
Programming in UML: An Introduction to fUML and Alf
 
Acceleo Code Generation
Acceleo Code GenerationAcceleo Code Generation
Acceleo Code Generation
 
Eugenia
EugeniaEugenia
Eugenia
 
ATL tutorial - EclipseCon 2008
ATL tutorial - EclipseCon 2008ATL tutorial - EclipseCon 2008
ATL tutorial - EclipseCon 2008
 
Mes 分析 第四週
Mes 分析 第四週Mes 分析 第四週
Mes 分析 第四週
 
Mes 分析 第二週
Mes 分析 第二週Mes 分析 第二週
Mes 分析 第二週
 
Eclipse World 2007: Fundamentals of the Eclipse Modeling Framework
Eclipse World 2007: Fundamentals of the Eclipse Modeling FrameworkEclipse World 2007: Fundamentals of the Eclipse Modeling Framework
Eclipse World 2007: Fundamentals of the Eclipse Modeling Framework
 
大資料分析技術的濫觴
大資料分析技術的濫觴大資料分析技術的濫觴
大資料分析技術的濫觴
 
Java Style Grading
Java Style Grading Java Style Grading
Java Style Grading
 
Animated transitions across UI views
Animated transitions across UI viewsAnimated transitions across UI views
Animated transitions across UI views
 
Minicurso grails
Minicurso grailsMinicurso grails
Minicurso grails
 
MATRACA: Ferramenta open source para auxílio a deficientes visuais no uso do ...
MATRACA: Ferramenta open source para auxílio a deficientes visuais no uso do ...MATRACA: Ferramenta open source para auxílio a deficientes visuais no uso do ...
MATRACA: Ferramenta open source para auxílio a deficientes visuais no uso do ...
 

Similar to Introducing MDSD

Close encounters in MDD: when Models meet Code
Close encounters in MDD: when Models meet CodeClose encounters in MDD: when Models meet Code
Close encounters in MDD: when Models meet Codelbergmans
 
Close Encounters in MDD: when models meet code
Close Encounters in MDD: when models meet codeClose Encounters in MDD: when models meet code
Close Encounters in MDD: when models meet codelbergmans
 
Modelling and code generation in .NET at Icinetic
Modelling and code generation in .NET at IcineticModelling and code generation in .NET at Icinetic
Modelling and code generation in .NET at IcineticIcinetic
 
Modelling and code generation in .NET at Icinetic
Modelling and code generation in .NET at IcineticModelling and code generation in .NET at Icinetic
Modelling and code generation in .NET at IcineticPedro J. Molina
 
Software engineering principles in system software design
Software engineering principles in system software designSoftware engineering principles in system software design
Software engineering principles in system software designTech_MX
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstElements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstEnea Gabriel
 
Model-Driven Software Development
Model-Driven Software DevelopmentModel-Driven Software Development
Model-Driven Software Developmentelliando dias
 
Software Factories in the Real World: How an IBM® WebSphere® Integration Fact...
Software Factories in the Real World: How an IBM® WebSphere® Integration Fact...Software Factories in the Real World: How an IBM® WebSphere® Integration Fact...
Software Factories in the Real World: How an IBM® WebSphere® Integration Fact...Prolifics
 
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"GlobalLogic Ukraine
 
20090410 J Spring Pragmatic Model Driven Development In Java Using Smart
20090410   J Spring Pragmatic Model Driven Development In Java Using Smart20090410   J Spring Pragmatic Model Driven Development In Java Using Smart
20090410 J Spring Pragmatic Model Driven Development In Java Using SmartSander Hoogendoorn
 
Sofwear deasign and need of design pattern
Sofwear deasign and need of design patternSofwear deasign and need of design pattern
Sofwear deasign and need of design patternchetankane
 
Model Driven Architectures
Model Driven ArchitecturesModel Driven Architectures
Model Driven ArchitecturesLalit Kale
 
Lightweight Model-Driven Engineering
Lightweight Model-Driven EngineeringLightweight Model-Driven Engineering
Lightweight Model-Driven EngineeringJordi Cabot
 
Innovation in model driven software
Innovation in model driven softwareInnovation in model driven software
Innovation in model driven softwareSagi Schliesser
 
Model driven software engineering in practice book - Chapter 9 - Model to tex...
Model driven software engineering in practice book - Chapter 9 - Model to tex...Model driven software engineering in practice book - Chapter 9 - Model to tex...
Model driven software engineering in practice book - Chapter 9 - Model to tex...Marco Brambilla
 
IPC07 Talk - Beautiful Code with AOP and DI
IPC07 Talk - Beautiful Code with AOP and DIIPC07 Talk - Beautiful Code with AOP and DI
IPC07 Talk - Beautiful Code with AOP and DIRobert Lemke
 
ACM SIGCHI EICS-2019 Keynote. Quid, Pedro J. Molina
ACM SIGCHI EICS-2019 Keynote. Quid, Pedro J. MolinaACM SIGCHI EICS-2019 Keynote. Quid, Pedro J. Molina
ACM SIGCHI EICS-2019 Keynote. Quid, Pedro J. MolinaPedro J. Molina
 

Similar to Introducing MDSD (20)

CG2010 Introducing MDSD
CG2010 Introducing MDSDCG2010 Introducing MDSD
CG2010 Introducing MDSD
 
Close encounters in MDD: when Models meet Code
Close encounters in MDD: when Models meet CodeClose encounters in MDD: when Models meet Code
Close encounters in MDD: when Models meet Code
 
Close Encounters in MDD: when models meet code
Close Encounters in MDD: when models meet codeClose Encounters in MDD: when models meet code
Close Encounters in MDD: when models meet code
 
Modelling and code generation in .NET at Icinetic
Modelling and code generation in .NET at IcineticModelling and code generation in .NET at Icinetic
Modelling and code generation in .NET at Icinetic
 
Modelling and code generation in .NET at Icinetic
Modelling and code generation in .NET at IcineticModelling and code generation in .NET at Icinetic
Modelling and code generation in .NET at Icinetic
 
Software engineering principles in system software design
Software engineering principles in system software designSoftware engineering principles in system software design
Software engineering principles in system software design
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstElements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code First
 
Model-Driven Software Development
Model-Driven Software DevelopmentModel-Driven Software Development
Model-Driven Software Development
 
Software Factories in the Real World: How an IBM® WebSphere® Integration Fact...
Software Factories in the Real World: How an IBM® WebSphere® Integration Fact...Software Factories in the Real World: How an IBM® WebSphere® Integration Fact...
Software Factories in the Real World: How an IBM® WebSphere® Integration Fact...
 
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Understanding Mda
Understanding MdaUnderstanding Mda
Understanding Mda
 
20090410 J Spring Pragmatic Model Driven Development In Java Using Smart
20090410   J Spring Pragmatic Model Driven Development In Java Using Smart20090410   J Spring Pragmatic Model Driven Development In Java Using Smart
20090410 J Spring Pragmatic Model Driven Development In Java Using Smart
 
Sofwear deasign and need of design pattern
Sofwear deasign and need of design patternSofwear deasign and need of design pattern
Sofwear deasign and need of design pattern
 
Model Driven Architectures
Model Driven ArchitecturesModel Driven Architectures
Model Driven Architectures
 
Lightweight Model-Driven Engineering
Lightweight Model-Driven EngineeringLightweight Model-Driven Engineering
Lightweight Model-Driven Engineering
 
Innovation in model driven software
Innovation in model driven softwareInnovation in model driven software
Innovation in model driven software
 
Model driven software engineering in practice book - Chapter 9 - Model to tex...
Model driven software engineering in practice book - Chapter 9 - Model to tex...Model driven software engineering in practice book - Chapter 9 - Model to tex...
Model driven software engineering in practice book - Chapter 9 - Model to tex...
 
IPC07 Talk - Beautiful Code with AOP and DI
IPC07 Talk - Beautiful Code with AOP and DIIPC07 Talk - Beautiful Code with AOP and DI
IPC07 Talk - Beautiful Code with AOP and DI
 
ACM SIGCHI EICS-2019 Keynote. Quid, Pedro J. Molina
ACM SIGCHI EICS-2019 Keynote. Quid, Pedro J. MolinaACM SIGCHI EICS-2019 Keynote. Quid, Pedro J. Molina
ACM SIGCHI EICS-2019 Keynote. Quid, Pedro J. Molina
 

More from Pedro J. Molina

dotnetMalaga-2020 Gestión de la configuración en aplicaciones Web
dotnetMalaga-2020 Gestión de la configuración en aplicaciones WebdotnetMalaga-2020 Gestión de la configuración en aplicaciones Web
dotnetMalaga-2020 Gestión de la configuración en aplicaciones WebPedro J. Molina
 
Infrastructure as Code with Terraform
Infrastructure as Code with TerraformInfrastructure as Code with Terraform
Infrastructure as Code with TerraformPedro J. Molina
 
LangDev 2022 Metamodeling on the Web with Essential
LangDev 2022 Metamodeling on the Web with EssentialLangDev 2022 Metamodeling on the Web with Essential
LangDev 2022 Metamodeling on the Web with EssentialPedro J. Molina
 
Essential as the base for Web DSLs
Essential as the base for Web DSLsEssential as the base for Web DSLs
Essential as the base for Web DSLsPedro J. Molina
 
Esencia de Web Components
Esencia de Web ComponentsEsencia de Web Components
Esencia de Web ComponentsPedro J. Molina
 
Esencia de web components
Esencia de web componentsEsencia de web components
Esencia de web componentsPedro J. Molina
 
Securizando por construcción mediante MDE
Securizando por construcción mediante MDESecurizando por construcción mediante MDE
Securizando por construcción mediante MDEPedro J. Molina
 
Building APIs with the OpenApi Spec
Building APIs with the OpenApi SpecBuilding APIs with the OpenApi Spec
Building APIs with the OpenApi SpecPedro J. Molina
 
Micro vs Nano (servicios)
Micro vs Nano (servicios)Micro vs Nano (servicios)
Micro vs Nano (servicios)Pedro J. Molina
 
Diseño de APIs con OpenAPI
Diseño de APIs con OpenAPIDiseño de APIs con OpenAPI
Diseño de APIs con OpenAPIPedro J. Molina
 
SVQDC 2017 Tecnologías para Microservicios
SVQDC 2017 Tecnologías para MicroserviciosSVQDC 2017 Tecnologías para Microservicios
SVQDC 2017 Tecnologías para MicroserviciosPedro J. Molina
 
Tecnologías para microservicios
Tecnologías para microserviciosTecnologías para microservicios
Tecnologías para microserviciosPedro J. Molina
 
Opensouthcode: Microservicios sobre MEAN Stack
Opensouthcode: Microservicios sobre MEAN StackOpensouthcode: Microservicios sobre MEAN Stack
Opensouthcode: Microservicios sobre MEAN StackPedro J. Molina
 

More from Pedro J. Molina (20)

MDE en la industria
MDE en la industriaMDE en la industria
MDE en la industria
 
Terraform
TerraformTerraform
Terraform
 
dotnetMalaga-2020 Gestión de la configuración en aplicaciones Web
dotnetMalaga-2020 Gestión de la configuración en aplicaciones WebdotnetMalaga-2020 Gestión de la configuración en aplicaciones Web
dotnetMalaga-2020 Gestión de la configuración en aplicaciones Web
 
Infrastructure as Code with Terraform
Infrastructure as Code with TerraformInfrastructure as Code with Terraform
Infrastructure as Code with Terraform
 
LangDev 2022 Metamodeling on the Web with Essential
LangDev 2022 Metamodeling on the Web with EssentialLangDev 2022 Metamodeling on the Web with Essential
LangDev 2022 Metamodeling on the Web with Essential
 
Are Startups for me?
Are Startups for me?Are Startups for me?
Are Startups for me?
 
Meow Demo
Meow DemoMeow Demo
Meow Demo
 
Essential as the base for Web DSLs
Essential as the base for Web DSLsEssential as the base for Web DSLs
Essential as the base for Web DSLs
 
Esencia de Web Components
Esencia de Web ComponentsEsencia de Web Components
Esencia de Web Components
 
Esencia de web components
Esencia de web componentsEsencia de web components
Esencia de web components
 
OpenAPI 3.0.2
OpenAPI 3.0.2OpenAPI 3.0.2
OpenAPI 3.0.2
 
Quid
QuidQuid
Quid
 
Securizando por construcción mediante MDE
Securizando por construcción mediante MDESecurizando por construcción mediante MDE
Securizando por construcción mediante MDE
 
Building APIs with the OpenApi Spec
Building APIs with the OpenApi SpecBuilding APIs with the OpenApi Spec
Building APIs with the OpenApi Spec
 
Micro vs Nano (servicios)
Micro vs Nano (servicios)Micro vs Nano (servicios)
Micro vs Nano (servicios)
 
Diseño de APIs con OpenAPI
Diseño de APIs con OpenAPIDiseño de APIs con OpenAPI
Diseño de APIs con OpenAPI
 
SVQDC 2017 Tecnologías para Microservicios
SVQDC 2017 Tecnologías para MicroserviciosSVQDC 2017 Tecnologías para Microservicios
SVQDC 2017 Tecnologías para Microservicios
 
Introducción a Angular
Introducción a AngularIntroducción a Angular
Introducción a Angular
 
Tecnologías para microservicios
Tecnologías para microserviciosTecnologías para microservicios
Tecnologías para microservicios
 
Opensouthcode: Microservicios sobre MEAN Stack
Opensouthcode: Microservicios sobre MEAN StackOpensouthcode: Microservicios sobre MEAN Stack
Opensouthcode: Microservicios sobre MEAN Stack
 

Introducing MDSD

  • 1. Introducing Model Driven Software Development Pedro J. Molina, PhD. Software Engineer Capgemini Spain | Valencia pjmolina@gmail.com http://pjmolina.com/metalevel
  • 2. Contents  Objective  What’s MDSD?  Why are we doing it?  How we can apply it?  CG2011 Program review 2
  • 3. Setting expectations  What to expect from CG2011?  The Europe leading conf. about Code Generation  Focused on practical tools and industrial experiences  A place to find and discuss with the Tool Makers  Probably one of the best places to learn and share knowledge about Code Generation  My objective with this session  Provide an overview to Code Generation  Provide clues to newcomers to select your own path in the conference 3
  • 4. Motivation: Programmers needed!  The impossible equation (Jean Bézivin) 1. Slow increase of professionals  Same trend in next 25 years 2. Rapid increase of SW to be developped 3. No way to cope with it 4. End User Programming  Example: Visical, Excel  By DSL, abstraction  Custom languages http://mymodelingblog.blogspot.com/2009/08/impossible-equation.html 4
  • 5. Abstraction Levels The entire history of software engineering is Application one of rising levels of abstraction (abstraction Domain is the primary way we as humans deal with complexity). Grady Booch Models / Specs Semantic Gap 4GL Abstraction level COBOL / C / Basic / Java Assembler Machine Code 5
  • 6. What’s a Domain? Real Time Management Systems Systems Air Traffic Luggage Insurance Control Tracking Systems Systems Systems  Focused on strict time  Focused on structure, data constrains and tracking and transactions 6
  • 7. What’s a Language? Declarative C(x) h2 2C(x) ih = – t 2m  x2 a>b && c==d John cookies 24 green Phil fish 32 blue <CallRecord> <caller><number>07713248</number> Textual Employee Name Position Description Graphical Address 0..* Salary Promote Assign class Invoice: Document Record Cost min. {  public void Bill() Duration Imperative Call DB 7
  • 8. What’s a model?  A model allows  the description of a family of problems for a domain  Having the abstraction level carefully selected to:  Discard irrelevant details (reduce complexity) Source  Discard constant details (reduce complexity)  Explicit important details (variables part) Class Relation Properties Cardinality  What’s a meta-model? Target  A model describing model. Customer Credit Card 1 * 8
  • 9. Some Acronyms  MD* (MDD = MDE = MDSD  MDA) MDSD  MDSD = Model-Driven Software Development MDA DSLs  MDD = Model Driven Development  MDE = Model Driven Engineering  MDA = Model Driven Architecture  OMG = Object Management Group  DSL = Domain Specific Language  AST = Abstract Syntactic Tree 9
  • 10. MDD  Model Driven Development Definition: The usage of Models as the main artefacts to Drive the software Development. 10
  • 11. Code Generation Model Code Assets Generator Definition: The automated synthesis of SW assets like source code, documentation or models using models as input. 11
  • 12. Novak’s rule “Automatic Programming is defined as the synthesis of a program from an specification. If automatic programming is to be useful, the specification must be smaller and easier to write than the program would be if written in a conventional programming language.” G.S. Novak 12
  • 13. Commonality / Variability  Family of programs (D. Parnas)  Common part  Standard, Fixed.  Implementable in common & shared base libraries  Variable part  Specify in the model  Generable 13
  • 14. Separation of Concerns (SoC) Know-How captured in two separated buckets: What How  Business Know-How:  Technological Know-How: captured in form of models captured & encapsulated in form of (specifications): isolated from best practices, frameworks, technological issues templates & code patterns in code generators & interpreters. 14
  • 15. ROI  Economies of Scale  Economies of Scope  Economics of MDSD  Development Life Cycle Impact  Quality 15
  • 16. Economies of Scale  Economies of Scale  The condition where few inputs, as effort and time, are needed to produce big quantities of a unique output. [Wit96] But: Can’t be applied to SW! Once the SW is produced Copy cost is = 0 £! Japanese Cookie Factory. Production Line. 16
  • 17. 17
  • 18. Economies of Scope  Economies of Scope  The condition where few inputs, as effort and time, are needed to produce a great variety of outputs. It is produced more added value producing in the same line different outputs. To produce each output independently creates an overcost in the common parts.  Economy of Scope occurs when the cost of combining two or more products in a unique product line is lower than producing them independently. [Wit96] 18
  • 19. MDSD: Economic Model Investment Domain Engineering Feedback:  Clients suggestions Application Development  Improvements for the Environment development environment Application Engineering ROI (development cost saving) Applications 19
  • 20. MDSD: Economic Model  Traditional Cost = N * CT  MDD cost = Inv + N * CF Saving AF = CT - CF 5 CT 4 CT Accumulated costs 3 CT 2 CT Inv CT 1 2 3 4 5 Family members 20
  • 21. SW Life-cycle Impact  More time in analysis and design tasks  Less time in coding  Less defect, more Quality  Improved productivity  Order of magnitude  Continuous Integration  Agile development cycles  Less cost 21
  • 22. Defects Cost and Distribution Traditional life cycle MDD life cycle Exponential cost % Defects 8€ of defects 4€ 2€ 1€ Analysis Design Coding Maintenance Snow ball effect 22
  • 23. Models: some Cases of Use 1. Validation 2. Interpretation 3. Code Generation Model Model Model Model Code Interpreter Checker Generation Runtime Code interpretation Metadata Generated Doc Report Code Config. Tests ... 23
  • 24. Conceptual Map for Code Generation Types Metamodel Templates Transformations Code Generator Instances Model Code Higher Abstraction Level Lower 24
  • 25. UML/MDA  UML: Unified Modelling Language  Origins: unified notation (from three sources, The Three Amigos)  OCL: constraint language  Great acceptation, common language for software engineering  MDA: Model Driven Architecture  MDA = MDSD with UML  Proposed by OMG  Profiles  PIM/PSM  MOF/XMI 25
  • 26. Code Generation with UML tools Types Metamodel Templates Transformations Instances Model Code Higher Abstraction Level Lower 26
  • 27. Code Generation with UML/MDA  Usage of UML Models  Extension mechanism: «persistent» Customer  Stereotypes  Profiles for specialized domains «pk» string Id «derived» double Balance  Good enough for:  Structure: class and properties  State transition diagrams (frequent in embedded systems) 27
  • 28. Code Generation with UML/MDA  As rich/poor enough as you can express and maintain in UML  “Only a 20% of UML is generally needed for SW development.” Ivar Jacobson  But: What percent of my problem can such 20% of UML solve?  Metamodel is highly closed  Only extensible at certain points  Shortcomings  Symbol and concept overloading  Not clear Semantics  Action Language  Domains not cover by UML: e.g. User Interfaces  Abuse of profiles  Forces models and semantics (One size doesn’t fit all)  Tools: many dialects of XMI  Babel’s Tower 28
  • 29. DSL  A DSL approach to MDSD gives you full control on the development of your metamodel  Powerful  Better well suited to your needs  “Do it yourself” approach  Tools to be built  Metamodels, editors, model checkers, compilers, code generators 29
  • 30. DSL  Internal DSL: Sample LINQ var studentPassList = from student in students where student.Score > 500 select student;  External DSL: Sample SQL SELECT Name, Surname FROM STUDENT WHERE Score > 500; 30
  • 31. Code Generation with EMF Types EMF Metamodel Templates Transformations Instances EMF Model Code Higher Abstraction Level Lower 31
  • 32. Code Generation with MS DSL Tools Types DSL Metamodel T4 Templates Transformations Instances DSL Model Code Higher Abstraction Level Lower 32
  • 33. Code generation techniques 1. Parse model Input Model 2. In-memory representation Template  AST / Object Model AST 3. Output building  Free text concatenation  XSL-T (ouch!)  Text Template based Output code 33
  • 34. Tools matters Metamodel(s) Reverse Textual Model Editor Engineering Tools Visual Model Editor Model(s) Model Checker IDE Model Transformation M2M M2T Code Model Doc, etc. 34
  • 35. Who are working in the area?  Eclipse EMF/GMF  Microsoft  IBM  DSL Tools  SAP  MetaCase  Obeo  MetaEdit+  Xtext  JetBrains  Itemis  MPS  Intentional Software  xUML / MDA  Intentional Workbench  Kennedy Carter  Blue Age  WebRatio  Artisan  Mendix  AndroMDA  Many more  Olivanova  … Presenting at CG2011 or LWC2011 35
  • 36. Language Workbenches Competition 2011 Tool Presenter MPS Markus Völter MetaEdit+ Steven Kelly OOMEGA Christian Merenda Whole Platform Riccardo Solmi Rascal Jurgen Vinju Spoofax Lennart Kats Intentional Mats Helander Essential Pedro J. Molina Obeo Designer Mariot Chauvin Xtext Karsten Thoms Session Chair: Angelo Hulshout Language Workbench: http://martinfowler.com/articles/languageWorkbench.html [Fowler2005] 36
  • 37. Programme Guide Keynotes  Terence Parr  ANTLR  StringTemplate Thursday 26th 9:00 H  Ed Merks  Eclipse Modeling Framework leader Friday 27th 9:00 H 37
  • 38. Programme Guide  Experience reports  Lesson from real MDSD applications  Tool tutorials and Hand on Labs  Learn to use them  Panels and Goldfish bowl  Promote debate and participation about a reference topic  Birds of a Feather  Formation of informal interest groups on the fly 38
  • 39. CG2011 Tips  Choose your path  Parallel tracks  Split your team  Check for slides of missing session on the conference web, SlideShare or InfoQ.com  Interact!  Tweet about it using the tag #cg2011  Install the CG2011 iPhone App  Introduce yourself and involve in the community  Ask whenever something is not clear to you  Ask for each dark acronym you find  Do not miss the traditional and relaxing punting trip!  Continue the discussion on the social network: http://modeldrivensoftware.net/ 39
  • 40. Conclusions  A change in SW development is needed  MDSD :  Provide leverage points to reach new levels of productivity  Offer a clear path to make better engineering in Computer Science 40