SlideShare a Scribd company logo
Gestión Avanzada de Datos
            @Santander – 21 July, 2011



          Model-Driven Engineering:
a first glance at a ¿new? way of conceiving
            software development


               Juan M. Vara
                juanmanuel.vara@urjc.es


           Kybele Research Group
          University Rey Juan Carlos
               (Madrid - Spain)
Agenda


    Motivation


    (Meta)Modeling


    MDA


    Putting MDE to work


    Conclusion


2    Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Motivation
                                  Software Complexity

    • Many modern software systems are reaching levels of complexity
      encountered in biological systems
       – Systems of systems each of which may include of millions of lines of code
       – … any one of which might be the culprit that brings down the entire system

                                         Mariner (1962)
                     • 18.5$ millions
                     • Programmer incorrectly transcribed a handwritten
                       formula (period instead of comma in FORTRAN loop)
    • Furthermore, we can only see an increase in complexity of
      software systems due to:
       – Growing demand for greater and more sophisticated functionality
    • Given our current track record, how will we cope with this rise in
      complexity?
3                      Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Motivation
                                  Software Complexity

       Essential                                                                                            Accidental
                         First, distinguising what can be simplified
      Complexity                                                                                            Complexity

    • Essential complexity: we have a hard problem
      – Inherent to the problem
      – Cannot be sidestepped or eliminated by technology or method
      – E.g., geospatial applications are inherently more “complex” than standard
         “forms over data” applications
    • Accidental complexity: we have made a problem hard
      – Due to the use of inappropriate technologies or methods
      – It happens because someone didn't find the simplest way to implement a
        specified set of features
      – Might be eliminated by good design, or good redesign.
      – E.g., banks legacy systems programmed in COBOL
4                      Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Motivation
                     Software Complexity



    Modern software development
     suffers from an excess of
      accidental complexity

    How can we deal with this rise
          in complexity?

5         Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Motivation
                          Software Complexity




    Can you see the
    underlying
    structure???




6                 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Motivation
                          Software Complexity




    Can you see the
    underlying
    structure???




               Much better,
                isn’t it???




7                 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Motivation
                  Software Complexity


      Clearly, models help on
        simplifying software
     development by raising the
    level of abstraction at which
        software is conceived

8         Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Motivation
                    Modeling in other disciplines
    • Modeling has been widely
      used in Engineering
      – Whith specification
        purposes
          Structure and behavior                                                                      Architecture
          Interacting with stakeholders
      – For reasoning about the                                   Avionics
        system
          Detecting design errors
          Infer and test properties
          Prototyping (simulation)
      – As a guide towards
        implementation …
9                    Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Motivation
              What happens with models in Software Engineering??


           Used (at best) with documentation purposes

               There is a big gap between the models and the
                         underlying implementation

       Models are not                    No way of ensuring                                          No tools or
     updated with design             programmers followed the
      changes made by               design decissions captured in                                   languages to
        programmers                            models                                              handle models



           Are we really doing Software Engineering??

10                    Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Motivation
                                                                                                              Let’s put models to work in Software Engineering
                                                                                                                                             The Remarkable Thing About Software
                                “Software has the rare property that it allows us to
                                     directly evolve models into full-fledged
                                implementations without changing the engineering
                                            medium, tools, or methods”
                                                                                                                                                                                                                           [John Hogg, 2003]

                                 Registrar Pago                  Seleccionar Imágenes                                   Guardar Resultado
                                                                                                  Mostrar Resultados
    (SIW)
    LAIM




              Validar Usuario      <<WS>>                                                         Del Procesamiento
                                 Validar Tarjeta                            Recibir Criterios
                                  de Crédito                                 de Búsqueda
                                                        Imágenes
                                                                                 Criterios

                                                        <<WS>>
    SACim




                                                    Recibir Imágenes
                                                                              <<WS>>
                                                                          Obtener Imágenes
                                                                                                       Resultados
                                                        Imágenes                Imágenes               Obtenidos


                                                                              <<<WS>>
    SPim




                                                                                                                                                        “from (models) human-readable to
                                                                        Realizar Procesamiento
                                                                             de Imágenes




                                Registrar Pago               Seleccionar Imágenes
                                                                                                 Mostrar Resultados
                                                                                                                       Guardar Resultado

                                                                                                                                                            computer-understandable”
(SIW)
LAIM




             Validar Usuario                                                                     Del Procesamiento
                                Validar Tarjeta
                                 de Crédito                               Recibir Criterios

                                                      Imágenes
                                                                           de Búsqueda

                                                                               Criterios                                                                                                            [J. Bézivin]
                                                   Recibir Imágenes
SACim




                                                                        Obtener Imágenes

                                                                                                     Resultados
                                                      Imágenes                Imágenes               Obtenidos
SPim




                                                                      Realizar Procesamiento
                                                                           de Imágenes




        11                                                                                                                                  Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Motivation
                       Model-Driven Engineering (and related disciplines)


          MDA      DSL ADM                                                                         Boost the role of models and
                                                                                                     modelling activities at the
               MIC       MDSD                                                                             different steps of the
                     MSE                                                                                     development cycle




                                     FROM CODING to
                                       MODELLING



                                                                                                                             Model-Driven
                                                                                         Component-based                     Engineering
                                                                                        Software Engineering
                                                          Structured
                                                        Programming         Object-Oriented                       Aspect-Oriented
                                                                             Programming                           Programming
                                                Assembly
         Raising the abstraction               Languages
     level in Software Development


12                              Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Motivation
                       Model-Driven Engineering (and related disciplines)


          MDA      DSL ADM                                                                         Boost the role of models and
                                                                                                     modelling activities at the
               MIC       MDSD                                                                             different steps of the
                     MSE                                                                                     development cycle




                               ROLE CODING to
                                FROM of         LEVEL of
                                  MODELLING
                               MODELS         AUTOMATION

                                                                                                                             Model-Driven
                                                                                         Component-based                     Engineering
                                                                                        Software Engineering
                                                          Structured
                                                        Programming         Object-Oriented                       Aspect-Oriented
                                                                             Programming                           Programming
                                                Assembly
         Raising the abstraction               Languages
     level in Software Development


13                              Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Agenda


     Motivation


     (Meta)Modeling


     MDA


     Putting MDE to work


     Conclusion


14    Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Modeling
                                 What’s in a model?
     • What is a model?
       – A model is a simplification of a system
         built with an intended goal in mind.
       – A model is a description of a system
         written in a well-defined language
           It should be able to answer questions in place of the actual system
           It allows us to use something that is simpler, safer or cheaper than
            reality instead of reality for some purpose.
           Thus, it allows us to deal with the world in a simplified manner, avoiding
            the complexity, danger and irreversibility of reality
           A model represents reality for the given purpose; the model is an
            abstraction of reality in the sense that it cannot represent all aspects of
            reality


15                     Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Modeling
                              What’s in a model?
     • A model is the simplified image of a system
        – MDE is recent but the idea of modeling is old



              System                                  repOf                                   Model




        – Plato (427-347 before JC), in Timeus compares
          vertebras to door hinges (74a) or blood vessels to
          irrigation channels
16                  Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Modelling
         How are models understood, interpreted, defined … ??

            Every map has a legend
             (implicit or explicit)




                       We cannot “get” the
                       map without its legend



     The legend is the
       metamodel


17                 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Modelling
         How are models understood, interpreted, defined … ??

            Every map has a legend
             (implicit or explicit)

        A model has no meaning when
        separated from its metamodel,
               We cannot “get” the
         that acts asitsthe filter for the
              map without legend
            reality to be modelled

     The legend is the
       metamodel


18                 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Modelling
            Metamodels act as filters for reality




      A (very simplistic )
           metamodel
     for modelling Meetings




19            Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Modelling
     Metamodels act as filters for reality




20     Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Modelling
          The OMG modelling stack (abstract)


                           A metamodel is the model of a modelling
                           language: it makes statements about what
                            can be expressed in the valid models of a
                                  certain modelling language.



                                 Metamodel
                                             c2                                          Terminology
     c2
                                                                                         Assertions
                                          Model
                                        (Terminal Model)



21           Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Modelling
          The OMG modelling stack (abstract)

     c2

                                 Metamodel
                                              c2


                                 Metamodel
                                                                                         Being a model, a
                                             c2                                          metamodel has to
                                                                                          conform to its
     c2                                                                                   corresponding
                                          Model                                            metamodel
                                        (Terminal Model)



22           Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Modelling
          The OMG modelling stack (abstract)

                                                                                c2
     c2

                          Metamodel
                         Metametamodel
                                              c2


                                 Metamodel
                                                                                     The metamodel
                                                                                   might be expressed
                                             c2
                                                                                     using the same
     c2
                                                                                   modelling language
                                          Model                                      that it defines.
                                        (Terminal Model)                             Then it’s called
                                                                                    metametamodel

23           Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Modelling
                       Don't confuse the model and the system
     •   Principle of limited substitutability.
          – A model M is said to be a representation of a system S for a given set of questions Q
             if, for each question of this set Q, the model M will provide exactly the same answer
             that the system S would have provided in answering the same question.
                           e.g. the globe is a model of the
                                       earth ….                                                    What is the temperature at the
                                                                                                bottom if I dig a 100 km deep hole at
                                                                                                      the surface of the earth ?


                                               repOf




                            … allowing to ask
                           certain questions …
                     Could I travel from Paris to New York
                        without using a boat or a plane?                                             … but not others …

24                            Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Modelling
             Aspects of a system represented by models




              Ma Mb                                                                       A given system may

     M1                                                Mc                                    have plenty of
                                                                                           different models


                                                                                            Each model
     isRepresentedBy
                                                                                         represents a given
                                                                                        aspect of the system
     M0
                 S
25                     Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Modelling
                 Different Models ↔ Different Languages


     Plumber's                                                                                         Electrician's
       view                                                                                               view
                                                    Architect's
                                                       view




                                                                                                Decorator's
      Carpenter's                                                                                  view
         view
                                                Phone Installer's
                                                      view
26                   Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Modelling
                       Domain Specific Languages (DSLs)

     • Domain Specific Languages (DSLs) are
                                                                                     SELECT  soh.[SalesOrderID]
       languages tailored to a specific                                                           ,soh.[OrderDate]
                                                                                                 ,soh.[ShipDate]
       application domain                                                                        ,sod.[ProductID]
                                                                                                 ,sod.[OrderQty]
                                                                                                 ,sod.[UnitPrice]
        – They offer substantial gains in expressiveness                                         ,soh.[CustomerID]
                                                                                     FROM [Sales].[SalesOrderHeader] AS soh
          and ease of use compared with general-                                     JOIN [Sales].[SalesOrderDetail] AS sod
                                                                                     ON soh.[SalesOrderID] =
          purpose programming languages in their                                                 sod.[SalesOrderID]
                                                                                     WHERE soh.[CustomerID] = 29559;
          domain of application
        – Higher-level abstraction than general
          purpose languages
        – Closer to the problem domain than
          to the implementation domain
        – Closer to domain experts


       Metamodels define (partially) Domain Specific Languages (DSLs)

27                       Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Modelling
                   Abstract syntax VS Concrete Syntax




                                                                                             Speaker(Mary)
                                                                                             Attendant(John)
                                                                                             Attendant(Peter)
                                                                                             Chair(c1)
                                                                                             Chair(c2)
        Same Model                    Same Abstractions                                      sat_on(John, c1)
     Different notations              Different syntaxes                                     sat_on(Peter, c2)

28                   Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Modelling
                          Abstract Syntax VS Concrete Syntax

                                                                                Abstract Syntax
                                                  • There are two types of objects: Furniture and
                                                    Person
                                                  • In turn, each Furniture object could be a Chair or a
                                                    Desk and each Person an Attendant or a Speaker
                                                  • Each Person can be sat on one (and only one) piece
                                                    of Furniture




                       Concrete Syntax
     – A box represents each Furniture or Person object
     – The name of the object is included into an inner box
     – Each occurrence of the relationship between
       Furniture and Person objects is represented by an
       arrow pointing to the Person object



29                           Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Modelling
                        Abstract Syntax VS Concrete Syntax

                                                                             Abstract Syntax
                                               • There are two types of objects: Furniture and
                                                 Person
                                               • In turn, each Furniture object could be a Chair or a
                                                 Desk and each Person an Attendant or a Speaker
                                               • Each Person can be sat on one (and only one) piece
                                                 of Furniture




                (Another) Concrete Syntax                                                    Speaker(Mary)
     – Each object is represented by the reserved word                                       Attendant(John)
       that designates the type of the object plus the name                                  Attendant(Peter)
       of the object between brackets
                                                                                             Chair(c1)
     – Each occurrence of the sat_on relationship is
       represented by the reserved work sat_on plus the
                                                                                             Chair(c2)
       name of the objects between brackets and                                              sat_on(John, c1)
       separated by commas                                                                   sat_on(John, c2)

30                        Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Agenda


     Motivation


     (Meta)Modeling


     MDA


     Putting MDE to work


     Conclusion


31    Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
MDA
                                   A way of doing MDE

               Sometimes MDA is referred to as
                   “MDE with standards”
      Role of models                      MDE principles                                                Automation




     Standards to formalize                                                   Categorization of
        MDE principles                                                        Abstraction Levels

                                        QVT
                                        OCL
                                       SPEM
                                       KDM
                                        …

32                     Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
MDA
                   Categorization of Abstraction Levels: CIM
                                                                                                                CIM      •Computer Independent Model

     • System requirements are modelled by Computer                                                             PIM      •Platform Independent Model

                                                                                                                PSM
       Independent Models (CIMs)                                                                               CODE
                                                                                                                         •Platform Specific Model

                                                                                                                         •Running system

        – The CIM model is a view of the business processes
        – … ellaborated by domain experts
        – … is not always mandatory, it depends on the specific domain
           addressed
                              Requirements Model
                        (use case and activity diagrams)




     • … serve as a bridge between domain experts
       and business analysts

33                        Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
MDA
                     Categorization of Abstraction Levels: PIM
                                                                                                                                                                                                                                                                                                                                                                                                                                                                 CIM                                                      •Computer Independent Model

     • The PIM models the system without considering                                                                                                                                                                                                                                                                                                                                                                                                              PIM                                                     •Platform Independent Model

                                                                                                                                                                                                                                                                                                                                                                                                                                                                 PSM
       specific platform technological details                                                                                                                                                                                                                                                                                                                                                                                                           CODE
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          •Platform Specific Model

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          •Running system

        – … allows the mapping to any technological platform
        – … think of a neutral virtual machine where each operation will be later implemented
          in the targetted platform
        – … is always mandatory and may result into one or more PSMs

                                                                                                                                                  CIM

                                                                                                                                                                                                                                                                                                                                                                     Huge gap between CIM
                                                                                                                                                                                                                                                                                                                                                                        and PIM levels
                                                                                                                                                                                Requirements Model                                                                                                                                                                             ↓
                                                                                                                                                                           (use case and activity diagrams)                                                                                                                                                             Traces at best
            PIM                   <<Interface>>
                                   PaymentFe
                             addPayment()
                             cancelPayment()
                             getPayments()
                             getPaymentActivity()
                             updatePayment()
                                                                                            <<Interface>>
                                                                                         PaymentFeExtended
                                                                                  addPaymentNoteExtended()
                                                                                  completePaymentExtended()
                                                                                  failPaymentExtended()
                                                                                  getPaymentsExtended()
                                                                                  pendPaymentExtended()
                                                                                                                                 <<Interface>>
                                                                                                                                 PaymentUtility
                                                                                                                             prepare()
                                                                                                                             getRouting()
                                                                                                                             checkForDuplicate()
                                                                                                                                                                                 : Consumer

                                                                                                                                                                                                1. Create payment
                                                                                                                                                                                                                   : ConsumerFrontEnd



                                                                                                                                                                                                                              1.1. Enter payment
                                                                                                                                                                                                                                                   : XmlConnector              : PaymentService

                                                                                                                                                                                                                                                        Sequence Diagram: InteliWorks
                                                                                                                                                                                                                                                        Consumer: Payment Realizations /
                                                                                                                                                                                                                                                        Consumer: Payment - Enter
                                                                                                                                                                                                                                                                                                                     : FinancialTransactionService




                                                                                  resubmitPaymentExtended()                                                                                   1.2. Display confirmation                                                                                                                                                                                                                                                                                  CreationData
                                                                                                                                                                                                                                                                                                                                                                                                                                           FinancialTransactionBase
                                                                                  reversePaymentExtended()                                                                                                                                                                                                                                                                                                                                                                        +creationData
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   1

                                  <<Interface>>                                                                                   <<Interface>>                                                                                                                                            Sequence Diagram: InteliWorks
                                                                                                                                  PaymentEvent                                                         2. Ok                                                                               Consumer: Financial Transaction
                                    Payment                                                                                                                                                                                                                                                Realizations / Consumer: Financial                                                                                                          FinancialTransactionConsumerData
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +displayStatus         DisplayStatus
                                                                                                                              processPayments()                                                                                 2.1. addPaymentRq
                            handlePayeeChange()                                                                                                                                                                                                                                            Transaction - Add                                                                                                                                                                  1                1

                                                                                                                                                                                                                                                               2.1.1. addPayment( )
                                                                                                                                                                                                                                                                                             2.1.1.1. addFinancialTransaction( )
                                                                                                                                                                                                                                                                                                                                                                                                                                           FinancialTransactionData           +processingData          ProcessingData
                                                                                                                                                                                                                                                                                               2.1.1.1.1. financialTransaction                                                                                                                                            1                    1

                               Notification                                                                                         FinancialTransactionCommon                                                                                                                                                                                                                                                                                                                                                   0..1
                             (from eMessenger)                                             PaymentService                           (from Financial Transaction Service)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       +status   1
                                                                                                                                                                                                                                                                2.1.1.2. payment                                                                               <<enumeration>>
                                                                                                                                                                                                                                                                                                                                                         FinancialTransactionTypeCode                    FinancialTransaction            FinancialTransactionExtended                                  ProcessingStatus
                                                                                                                                                                                                                                                                                                                                                      PAYMENT
                                                                                                                                                                                                                                                                                                                                                      FUNDS_TRANSFER
                                                                                                                                                                                                                               2.1.2. addPaymentRs                                                                                                                                                            0..1                                0..1           0..1                                  +status   1
                                                                                                                                    FinancialTransactionUtility                                                                                                                                                                                                                                1
                                                                                                                                                                                                                                                                                                                                                                           +transactionType                                                                                             +previousStep
                            SchedulingEvent                                                                                        (from Financial Transaction Service)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 0..1
                                                                                                                                                                                                                                                                                                                                                                                                                1    +specification                 *    +note                        *
                             (from Scheduler)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   {ordered}
                                                                                                                                                                                                                                                                                                                                                                              +amount
                                                                                                                                                                                                                                                                                                                                                         CurrencyAmount                            FinancialTransactionSpecification                 Note                                               ProcessingStep
                                                                                                                                                                                                   3. Close view                                       Sequence Diagram: InteliWorks                                                                                          1         0..1
                                                                                                                                                                                                                              3.1. View payments       Consumer: Payment Realizations /
                                                                                                                                     FinancialTransaction                                                                                              Consumer: Payment - View Payments
                                                                                                                               (from Financial Transaction Service)
                              PayeeUtility




                                        AccountUtility


                                                     OperationalDirectory
                                                (from Operational Directory Service)

                                                                             PaymentRead                FinancialTransactionRead

                                                                                       FinancialTransactionWrite




                    Navigation Maps                User Interface                                                                                                                                                                                                                                                                                    Conceptual Data Model
           (Class diagrams + Activity diagrams) (Sequence diagrams)                                                                                                                                                                                                                                                                                     (E/R diagrams)

34                                Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
MDA
                                 Categorization of Abstraction Levels: PSM (& Code)

     •   Specifications described in the PIMs are adapted to specific                                                                                                                                                                                                                                                                                                                                                                                                                 CIM                                                  •Computer Independent Model

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        PIM                                                •Platform Independent Model
         platforms by means of Platform Specific Models (PSMs) from which                                                                                                                                                                                                                                                                                                                                                                                                               PSM                                                •Platform Specific Model

         the code is automatically generated                                                                                                                                                                                                                                                                                                                                                                                                                                CODE                                                           •Running system

               PIM                                 <<Interface>>
                                                    PaymentFe
                                              addPayment()
                                              cancelPayment()
                                              getPayments()
                                              getPaymentActivity()
                                              updatePayment()
                                                                                                             <<Interface>>
                                                                                                          PaymentFeExtended
                                                                                                   addPaymentNoteExtended()
                                                                                                   completePaymentExtended()
                                                                                                   failPaymentExtended()
                                                                                                   getPaymentsExtended()
                                                                                                   pendPaymentExtended()
                                                                                                                                                  <<Interface>>
                                                                                                                                                  PaymentUtility
                                                                                                                                              prepare()
                                                                                                                                              getRouting()
                                                                                                                                              checkForDuplicate()
                                                                                                                                                                                              : Consumer

                                                                                                                                                                                                             1. Create payment
                                                                                                                                                                                                                                : ConsumerFrontEnd



                                                                                                                                                                                                                                           1.1. Enter payment
                                                                                                                                                                                                                                                                : XmlConnector              : PaymentService

                                                                                                                                                                                                                                                                     Sequence Diagram: InteliWorks
                                                                                                                                                                                                                                                                     Consumer: Payment Realizations /
                                                                                                                                                                                                                                                                     Consumer: Payment - Enter
                                                                                                                                                                                                                                                                                                                                  : FinancialTransactionService




                                                                                                   resubmitPaymentExtended()                                                                               1.2. Display confirmation                                                                                                                                                                                                                                                                                      CreationData
                                                                                                                                                                                                                                                                                                                                                                                                                                                           FinancialTransactionBase
                                                                                                   reversePaymentExtended()                                                                                                                                                                                                                                                                                                                                                                        +creationData
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1

                                                   <<Interface>>                                                                                   <<Interface>>                                                                                                                                        Sequence Diagram: InteliWorks
                                                                                                                                                   PaymentEvent                                                     2. Ok                                                                               Consumer: Financial Transaction
                                                     Payment                                                                                                                                                                                                                                            Realizations / Consumer: Financial                                                                                                             FinancialTransactionConsumerData
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   +displayStatus         DisplayStatus
                                                                                                                                               processPayments()                                                                             2.1. addPaymentRq
                                             handlePayeeChange()                                                                                                                                                                                                                                        Transaction - Add                                                                                                                                                                     1                 1

                                                                                                                                                                                                                                                                            2.1.1. addPayment( )
                                                                                                                                                                                                                                                                                                          2.1.1.1. addFinancialTransaction( )
                                                                                                                                                                                                                                                                                                                                                                                                                                                           FinancialTransactionData           +processingData           ProcessingData
                                                                                                                                                                                                                                                                                                            2.1.1.1.1. financialTransaction                                                                                                                                               1                     1

                                                Notification                                                                                         FinancialTransactionCommon                                                                                                                                                                                                                                                                                                                                                   0..1
                                              (from eMessenger)                                             PaymentService                           (from Financial Transaction Service)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +status   1
                                                                                                                                                                                                                                                                             2.1.1.2. payment                                                                                 <<enumeration>>
                                                                                                                                                                                                                                                                                                                                                                        FinancialTransactionTypeCode                     FinancialTransaction            FinancialTransactionExtended                                   ProcessingStatus
                                                                                                                                                                                                                                                                                                                                                                     PAYMENT
                                                                                                                                                                                                                                                                                                                                                                     FUNDS_TRANSFER
                                                                                                                                                                                                                                            2.1.2. addPaymentRs                                                                                                                                                               0..1                                0..1           0..1                                   +status   1
                                                                                                                                                     FinancialTransactionUtility                                                                                                                                                                                                                               1
                                                                                                                                                                                                                                                                                                                                                                                          +transactionType                                                                                               +previousStep
                                             SchedulingEvent                                                                                        (from Financial Transaction Service)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  0..1
                                                                                                                                                                                                                                                                                                                                                                                                                                1    +specification                 *    +note                         *
                                              (from Scheduler)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    {ordered}
                                                                                                                                                                                                                                                                                                                                                                                             +amount
                                                                                                                                                                                                                                                                                                                                                                        CurrencyAmount                             FinancialTransactionSpecification                 Note                                                ProcessingStep
                                                                                                                                                                                                                3. Close view                                       Sequence Diagram: InteliWorks                                                                                            1          0..1
                                                                                                                                                                                                                                           3.1. View payments       Consumer: Payment Realizations /
                                                                                                                                                      FinancialTransaction                                                                                          Consumer: Payment - View Payments
                                                                                                                                                (from Financial Transaction Service)
                                               PayeeUtility




                                                         AccountUtility


                                                                      OperationalDirectory
                                                                 (from Operational Directory Service)

                                                                                              PaymentRead                FinancialTransactionRead

                                                                                                        FinancialTransactionWrite




                      Navigation Maps                User Interface                                                                                                                                                                                                                                                                                                Conceptual Data Model
             (Class diagrams + Activity diagrams) (Sequence diagrams)                                                                                                                                                                                                                                                                                                 (E/R diagrams)


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           AUTOMATION
            PSM  xxxxxxxxxxxxxxxxxxxxxxx
                 xxxxxxxxxxxxxxxxxxxx
                     xxxxxxxxxxxxxxxxxxxxx
                                                                                                                                    xxxxxxxxxxxxxxxxxxxxxxx
                                                                                                                                    xxxxxxxxxxxxxxxxxxxx
                                                                                                                                        xxxxxxxxxxxxxxxxxxxxx
                                                                                                                                                                                                                                                                                       xxxxxxxxxxxxxxxxxxxxxxx
                                                                                                                                                                                                                                                                                       xxxxxxxxxxxxxxxxxxxx
                                                                                                                                                                                                                                                                                           xxxxxxxxxxxxxxxxxxxxx
                                                                                                                                                                                                                                                                                                                                                                                AUDIT_ID : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                                       FINANCIAL_T RANSACTIONS

                                                                                                                                                                                                                                                                                                                                                                                ACTION_CODE : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                FI_TRANSACTION_SEQ_ID : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                LAST_MODIFIED_BY : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                CONSUMER_SEQ_ID : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                TRANSACT ION_TYPE : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                MODEL_INST ANCE_NUMBER : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                RECURRING_MODEL_SEQ_ID : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                SOURCE_ACCOUNT _SEQ_ID : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                SOURCE_ACCOUNT _T YPE_CODE : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         AUDIT_ID : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         ACTION_CODE : NUMBER(9, 0)


                                                                                                                                                                                                                                                                                                                                                                                                                                                         BILL_SEQ_ID : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         PROVIDER_SEQ_ID : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         PAYEE_NAME : VARCHAR2(255)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        PAYMENTS



                                                                                                                                                                                                                                                                                                                                                                                                                                                         FI_TRANSACTION_SEQ_ID : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         PAYEE_SEQ_ID : NUMBER(9, 0)




                                                                                                                                                                                                                                                                                                                                                                                                                                                         PAYEE_PHONE_NUMBER : VARCHAR2(32)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         NAME_ON_ACCOUNT : VARCHAR2(255)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         BILLING_ACCOUNT : VARCHAR2(255)

                    xxxxxxxxxxxx                                                                                                       xxxxxxxxxxxx                                                                                                                                       xxxxxxxxxxxx                                                                          SOURCE_ACCOUNT _NUMBER : VARCHAR2(32)
                                                                                                                                                                                                                                                                                                                                                                                SOURCE_ROUT ING_NUMBER : VARCHAR2(9)
                                                                                                                                                                                                                                                                                                                                                                                SOURCE_ACCOUNT _HOLDER : VARCHAR2(255)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         PAYMENT_DESTINAT ION_TYPE : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         ADDRESS1 : VARCHAR2(64)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         ADDRESS2 : VARCHAR2(64)

                     xxxxxxxxxxxxxxxxx                                                                                                  xxxxxxxxxxxxxxxxx                                                                                                                                  xxxxxxxxxxxxxxxxx                                                                    REQUESTED_DAT E : DATE
                                                                                                                                                                                                                                                                                                                                                                                REQUESTED_SCHEDULE_TYPE : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         ADDRESS3 : VARCHAR2(64)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         ADDRESS4 : VARCHAR2(64)
                                                                                                                                                                                                                                                                                                                                                                                CREDIT_DATE : DATE                                                       CITY : VARCHAR2(32)

                       xxxxxxxxxxxxx                                                                                                      xxxxxxxxxxxxx                                                                                                                                      xxxxxxxxxxxxx                                                                      PROCESS_DAT E : DATE
                                                                                                                                                                                                                                                                                                                                                                                DISPLAY_STAT US_CODE : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         ST ATE_PROV : VARCHAR2(32)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         POSTAL_CODE : VARCHAR2(11)
                                                                                                                                                                                                                                                                                                                                                                                CURRENCY_CODE : CHAR(3)                                                  COUNT RY_CODE : CHAR(3)
                        xxxxxxxxxxx                                                                                                        xxxxxxxxxxx                                                                                                                                        xxxxxxxxxxx                                                                       AMOUNT : NUMBER(17, 2)
                                                                                                                                                                                                                                                                                                                                                                                CONSUMER_MEMO : VARCHAR2(255)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         ACT_PAYEE_NAME : VARCHAR2(255)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         REMITTANCE_METHOD : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                DISPLAY_STAT US_MODIFIED_DAT E : DATE                                    ACT_PAYEE_PHONE_NUMBER : VARCHAR2(32)
                     xxxxxxxxxxxxxx                                                                                                     xxxxxxxxxxxxxx                                                                                                                                     xxxxxxxxxxxxxx                                                                       DISPLAY_STAT US_MODIFIED_BY : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                DISPLAY_STAT US_NOT E : VARCHAR2(255)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         ACT_NAME_ON_ACCOUNT : VARCHAR2(255)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         ACT_BILLING_ACCOUNT : VARCHAR2(255)
                                                                                                                                                                                                                                                                                                                                                                                PROCESSING_FLOW_TYPE : NUMBER(9, 0)                                      ACT_PAYMENT _DEST INATION_TYPE : NUMBER(9, 0)
                     xxxxxxxxxxxxx                                                                                                      xxxxxxxxxxxxx                                                                                                                                      xxxxxxxxxxxxx                                                                        PROCESSING_TIME : DATE
                                                                                                                                                                                                                                                                                                                                                                                RETRY_COUNT : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         ACT_ADDRESS1 : VARCHAR2(64)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         ACT_ADDRESS2 : VARCHAR2(64)

                 xxxxxxxxx                                                                                                          xxxxxxxxx                                                                                                                                          xxxxxxxxx                                                                                DESTINATION_PROVIDER_SEQ_ID : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                PROCESS_STATUS_CODE : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                AUTHORIZAT ION_PROVIDER_SEQ_ID : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         ACT_ADDRESS3 : VARCHAR2(64)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         ACT_ADDRESS4 : VARCHAR2(64)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         ACT_CITY : VARCHAR2(32)

                 xxxxxxxxx                                                                                                          xxxxxxxxx                                                                                                                                          xxxxxxxxx                                                                                DAYS_TO_CREDIT : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                SOURCE_PROVIDER_SEQ_ID : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                VALIDATE_STATUS_CODE : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         ACT_STATE_PROV : VARCHAR2(32)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         ACT_POST AL_CODE : VARCHAR2(11)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         ACT_COUNTRY_CODE : CHAR(3)

                 xxxxxxx                                                                                                            xxxxxxx                                                                                                                                            xxxxxxx                                                                                  PROCESS_STATUS_PROVIDER_SEQ_ID : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                PROCESS_STATUS_MODIFIED_BY : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                PROCESS_STATUS_MODIFIED_DATE : DAT E
                                                                                                                                                                                                                                                                                                                                                                                                                                                         CHECK_NUMBER : VARCHAR2(40)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         ACT_REMITT ANCE_METHOD : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         SERVICE_CENT ER_SEQ_ID : NUMBER(9, 0)

                    xxxxxxxxxx                                                                                                         xxxxxxxxxx                                                                                                                                         xxxxxxxxxx                                                                            PROCESS_STATUS_NOTE : VARCHAR2(255)
                                                                                                                                                                                                                                                                                                                                                                                VALIDATE_STATUS_MODIFIED_BY : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                VALIDATE_STATUS_MODIFIED_DATE : DAT E
                                                                                                                                                                                                                                                                                                                                                                                                                                                         MERCHANT _SEQ_ID : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         DEFAULT _ROUTING_REASON : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         DAYS_TO_PROCESS : NUMBER(9, 0)

                     xxxxxxx                                                                                                            xxxxxxx                                                                                                                                            xxxxxxx                                                                              AUDIT_DAT E : DATE
                                                                                                                                                                                                                                                                                                                                                                                AUDIT_VERSION : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                VALIDATE_STATUS_NOTE : VARCHAR2(255)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         AUDIT_VERSION : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         AUDIT_GENERATION : NUMBER(9, 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                         AUDIT_DAT E : DATE

                  ]xxxx                                                                                                              ]xxxx                                                                                                                                              ]xxxx                                                                                   AUDIT_GENERATION : NUMBER(9, 0)




              Interface Code                                           Web Services Code                                                                                                                                          Value Object Code                                                                                                               Database Design Model
                   (EJB)                                                 (WSDL/SOAP)                                                                                                                                                    (Java)                                                                                                                        (class diagram)



                                                                                                                                                                                            WORKING CODE

35                                                     Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
MDA
                                 Model Transformations
     •   Model Transformations are the key to automate any model-driven
         development process
                                     Two conceptions
                                                    though they are
                                                   just one indeed 


                     M2M                                                                                        M2T
                model-to-model                                                         model-to-text
                transformations                                                       transformations
                                                                                       (… aka code generation or
                                                                                          model serialization)




                                                                                        CREATE TYPE cast_type AS (
                                                                                          id                                INTEGER(25),
                                                                                          casting_order                     INTEGER,
                                                                                          role                              CHARACTER VARYING(25),
                                                                                          actor                             Ref _actor_type,
                                                                                          movie                             Ref _movie_type
                                                                                        );

                                                                                        CREATE TABLE casts OF cast_type (
                                                                                           id                               PRIMARY KEY,
                                                                                           role                             NOT_NULL,
                                                                                           actor                            NOT NULL
                                                                                        );

                                                                                        CREATE TYPE Ref _cast_type AS (
                                                                                          ref REF cast_type
                                                                                        );




36                       Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
MDA
                               Model Transformations

                                                                                                                         conforms to
                                         Metametamodel
     Model transformations                                Class
               as                                         Class
     transformation models


                                         MMt                  Class
     MMa                                                      Rule                                     Class                        MMb
                   Class                                                                               Pink
                   Green                                                                                                    Class
           Class
           Red                           MMa2MMb                       Rule                                                 Blue
                                                                       G2P
                                                Rule
                                                R2B



      Ma                                                                                         Mb




37                     Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
MDE
                   The Unified Modelling Language

     • UML (Unified Modelling Language)
       – A GPL modelling language for specifying
         sofware systems
           Mainly object-oriented
       – Aims at being a universal modelling standard



                                                                                            Several types of
                                                                                             diagrams for
                                                                                           specific purposes



38                  Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
MDA
             MOF: Stages in the Evolution of Languages at the OMG.

                                                                                                       How has MOF
     (a)          (b)                                                         (c)
                                                                                                        come to be?



                 MOF                                                        MOF


     UML         UML                    UML              SPEM               CWM                 QVT                  etc.




     aUML        aUML                   aUML             anSPEM              aCWM               a QVT               a…
     Model       Model                  model             model              model              model              model

39                   Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
MDA
                                    Meta-Object Facility

     • A metadata management
       framework.
        – It is an OMG-standard
          metamodelling language.
        – A language to be used for
          defining languages or …
        – A DSL for defining new
          DSLs 




                                                         Simplified MOF
                                                           Metamodel


40                      Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
MDA
                           XML Metadata Interchange

     • An XML-based standard for sharing meta-data
        – A set of rules to generate XML Schemas for MOF based metamodels.
        – A Schema for UML           The most popular
        – A Schema for MOF
        – A set of rules to generate XML documents from instances of MOF models


                      Meta-Metamodel
                           MOF
                                                                               conforms to
                                                                                                          It is quite rare to
                                                                                                         find two different
                                                                                                           tools using the
                           UML                                              XMI Schema                         same XMI
                         Metamodel                                            (UML)                            version!!!

                                                                                                          OMG's Model
                                                                               XMI
                      An UML model (m)                                       Document                      Interchange
                                                                                                          Working Group

41                     Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
MDA
                                                         UML Profiles

     • UML provides a lightweight extension mechanism
        – A UML profile is a modelling package containing modelling
          elements customized for a specific purpose or domain
        – Such new elements are defined by extending existing ones
                   By combining stereotypes, tagged values, and constraints
        <<profile>>
        XMLSchema                                                                      MySchema

                                         << stereotype >>
                                                                                                                   nameSpace: KYB_MYXSD
                                        XML Complex Type
         << metaclass >>
                                    nameSpace: String
             Class
                                                                                                  << XML Complex Type >>
                                                                                                       Person_Type
                                          << stereotype >>
                                           XML Element
                                                                        <<apply>>                                          compositor: Sequence
        << metaclass >>                                                               << Complex Content >>
          Association
                                           << stereotype >>                                                                      << Complex Content >>
                                          Complex Content

           << enumeration >>       compositor: CompositorType                                                                << XML Element >>
           CompositorType                                                                                                         NAME
                                                                                             << XML Element >>
       All                                                                                         NIF
       Choice
       Sequence




42                               Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
MDA
                     UML Profiles – Defining new DSLs

                                                                                                  How has MOF
     (a)     (b)                                                         (c)
                                                                                                   come to be?



             MOF                                                       MOF


     UML     UML                   UML              SPEM                CWM                 QVT

                                                                                                           UML profile
                                                                                                            for XSD




     aUML    aUML                  aUML             anSPEM              aCWM               a QVT                a XSD
     Model   Model                 model             model              model              model                model

43              Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
MDA
                       Common Warehouse metamodel - CWM

     • OMG specification for modeling
       metadata
       – Related to development of data
         warehouses
     • Representation of data structures
       according to different technologies
       – Relational, multidimensional, XML, flat
         files, etc.
     • CWM models enable users to trace
       the lineage of data
       – Where are data come from?
       – When were data created?
       – How were data created?
44                      Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
MDA
                  Common Warehouse metamodel - CWM



     Management                        Warehouse                                            Warehouse
                                        Process                                             Operation



     Analysis          Transformation              OLAP
                                                                Data            Information               Business
                                                                Mining          Visualization           Nomenclature



     Resource              Object                                                           Multi
                                              Relational             Record                                          XML
                           (UML)                                                         Dimensional



     Foundation        Business    Data
                                                        Expressions
                                                                              Keys         Type              Software
                      Information Types                                       Index       Mapping           Deployment



                                                      UML 2.0
                               (Foundation, Behavioral_Elements, Model_Management)



45                 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
MDA
     Common Warehouse metamodel - CWM

       MOF          • Excerpt of relational metamodel




46    Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
MDA
                                       Next steps??? MDA ↔ ADM
     •    Architecture Driven Modernization
            – Process of understanding and evolving existing software assets for the purpose of
                 Improvement                        ADM is another OMG initiative intended to be
                 Refactoring                             the reverse of MDA: MDA covering
                                                        forward engineering while ADM covers
                 Reuse                                       also backward engineering
                 Migration into another language
                 Service-oriented architecture …                         PIM
                       KDM
              a common intermediate
         representation for existing software
                      systems
                                                                                    PSM                                         PSM


              Abstract Syntax Tree
              Metamodel (ASTM)                        Legacy
            a modelling language for fine
            grained reverse engineering               Systems

                                                                         Platforms of yesterday                         Platforms of today
                                                                                                                         (even tomorrow)
                                                                                                                                

47                                  Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Agenda


     Motivation


     (Meta)Modeling


     MDA


     Putting MDE to work


     Conclusion


48    Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Putting MDE to work
                                           M2DAT-DB Overview



                                       Conceptual
     PIM




                                       Data Model                Model-to-Model Transformations


                                                                                                                        Tree-like Editor
                                                                                                                                (EMF)




                                       UML2SQL2003
     PSM




                                         PSM




            OR Model   ORA2SQL2003      OR Model                                XML
                       SQL20032ORA        SQL2003                               Model

                                                                                                                           Diagrammer
                                                                                                                                 (GMF)
     CODE




                                                                                    XML
              SQL                           SQL                                   Schema




                             Model-to-Text Transformations                                                            Model Validation
                                                                                                                           (EVL Files)
              Modelling
            ORDB Schemas                 MOFScript


49                          Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Putting MDE to work: M2DAT-DB
                        Modelling ORDB Schemas : ORDB4ORA Metamodel

                             c2

     Ecore ≈   Eclipse MOF


                 c2

     ORDB4ORA.ecore

                 c2

     Sample.ordb4ora




50                           Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Putting MDE to work: M2DAT-DB
                         Modelling ORDB Schemas: model editors

                                                                                           c2


                                                         ECore
     EMF generates a tree-
     based editor with                                                                                      GMF generates a
     basic capabilities                                          c2
                                                                                                        complete diagrammer


                                               ORDB4ORA.ecore
                                                 c2




                                                                 c2




                                               Sample.ordb4ora                              Sample.ordb4ora_diagram




51                           Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Putting MDE to work
                                                             M2DAT-DB Overview



                                                         Conceptual
                                                                                   Model-to-Model Transformations
     PIM




                                                         Data Model
                                                                                               Graph Grammars
                                                                                                      ↓
                                                                                           ATL Mapping Rules (ATL)
                                                                                                      ↓                                   Tree-like Editor
                                                                                            Design Decisions (AMW)                                (EMF)


            Replicate Model Transformation
                  (VIATRA, QVTo, mediniQVT)




                                                         UML2SQL2003
     PSM




                                                                                       M2M XML
                                                                                           Transformation
                                                           PSM




                OR Model            ORA2SQL2003           OR Model
                                     SQL20032ORA            SQL2003                          UML2
                                                                                          Model
                                                                                               ↓↓↓
                                                                                                                                             Diagrammer
                                                                                          ORDB4ORA                                                 (GMF)
     CODE




                                                                                                      XML
                    SQL                                       SQL                                   Schema




                                               Model-to-Text Transformations                                                            Model Validation
                                                                                                                                             (EVL Files)
                                                             (MOFScript)




52                                            Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Putting MDE to work: M2DAT-DB
                                                       Model to Model Transformation
                                                                             Vara, J. M., Vela, B., Bollati, V., & Marcos, E. (2009). Supporting Model-Driven Development
                                                                             of Object-Relational Database Schemas: a Case Study Paper presented at the ICMT2009 -
                                                                             International Conference on Model Transformation, Zurich, Switzerland. Springer-Verlag,
                                                                             Berlin, Heidelberg, 181-196.

                         Natural                                                                         • QVT Usability
                        Language                                                                         • ATL Adoption
                                                                                                             — Support
                                                                                                             — Interoperability

                                                                             Graph
                                                                           Grammars
                                                                          Formalization


         •     Shorten the distance between M2M
               toolsmiths and practitioners                                                                                  ATL
         •     Detect errors and inconsistencies at first
               stages of development
                                                                                                                        Implementation
     Vara, J. M., Vela, B., Cavero, J. M., and Marcos, E. 2007. Model transformation for object-relational
     database development. In Proceedings of the 2007 ACM Symposium on Applied Computing (Seoul, Korea, March
     11 - 15, 2007). SAC '07. ACM, New York, NY, 1012-1019.

53                                             Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Putting MDE to work: M2DAT-DB
                                             Model to Model Transformation


                                                                                                      Product Data PSM
                     Data PIM              Standard Data PSM (SQL:2003)
                                                                                                         (Oracle10g)
                       Class                Structured Type + Typed Table                        Object Type + Object Table
                   Class Extension                     Typed Table                                   Table of Object Type
                       Multivalued                    Array/Multiset                                 Varray/Nested Table
     Attributes




                       Composed            ROW/Structured Type (column)                              Object Type (column)
                      Calculated                     Trigger/Method                                     Trigger/Method
                      One-To-One                         Ref/Ref                                            Ref/Ref
                      One-To-Many                  Ref/Multiset/Array                             Ref/Nested Table/Varray
     Association




                     Many-To-Many          Multiset/Multiset - Array/Array             Nested Table/Nested Table - Varray/Varray

                       Aggregation                    Multiset/Array                         Nested Table/Varray of References
                                                                                                     Nested Table/Varray
                      Composition                     Multiset/Array
                                                                                                          of Objects
                     Generalization                Types/Typed Tables                                Types/Typed Tables




54                                   Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Putting MDE to work: M2DAT-DB
                                             M2M transformation: Classes and Properties

                                                                                                 1    rule Class2UDT {
        LHS                                               RHS
                                                                                                 2     from
        - UML Class Diagram -                             - OR Model -
                                                                                                 3       c : UML!Class
                                                                                                 4     to
                            1                                                        1‟          5       udt : ORDB4ORA!StructuredType(
         ???:UML::Class                         match(1).name:OR::Typed Table
                                                                                                 6            Name <- c.name + „ <<UDT>>',
         name:String=???                                                                         7            typed <- tt,
                                                                                                 8            method <- meth_seq,
                                                                                          1‟
                                            match(1).name + “_Type”:OR::Structured Type          9            supertype <- if (not c.generalization-> first()->oclIsUndefined()) then
     ownedAttibute
                                                                                                 10                                c.generalization->first().general
                                                                                                 11                               else
                     *          2                                                                12                                OclUndefined
        ???:UML::Property                                         *
                                                                                2‟               13                               endif,
        name:String=??                           match(2).name:OR::Attribute                     14            model <- thisModule.package
        datatype:Datatype=??                     datatype = match(2).datatype                    15            ),
                                                                                                 16      meth_seq : distinct ORDB4ORA!Method foreach
                                                                                                 17                          (op in c.ownedOperation)(Name <- op.name),
                                                                                                 18      tt : ORDB4ORA!TypedTable(
                                                                                                 19                          Name <- c.name + 's <<PERSISTENT>>')
                                                                                                 20   }
                                                                                                 21
                                                                                                 22   rule Property2Attribute {
                                                                                                 23     from
                                                                                                 24       p:UML!Property (not p.isDerived and not p.isMultivalued() and
                                                                                                 25                         p.refImmediateComposite().oclIsTypeOf(UML!Class))
                                                                                                 26     to
                                                                                                 27       a : ORDB4ORA!Attribute(
                                    rule Class2UDT {…}                                           28          Name <- p.name,
                                    rule Property2Attribute {…}                                  29          Type <- p.type,
                                                                                                 30          structured <- p->refImmediateComposite())
                                                                                                 31   }



                                                                                                                                          Product Data PSM
                                                                                                                  Data PIM
                                                                                                                                              (Oracle10g)
                                                                                                                      Class            Object Type + Object Table
                                                                                                                   Property                           Attribute

55                                              Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Putting MDE to work: M2DAT-DB
                                              M2M transformation: Classes and Properties

                                                                                                 1    rule Class2UDT {
        LHS                                               RHS
                                                                                                 2     from
        - UML Class Diagram -                             - OR Model -
                                                                                                 3       c : UML!Class
                                                                                                 4     to
                            1                                                        1‟          5       udt : ORDB4ORA!StructuredType(
         ???:UML::Class                         match(1).name:OR::Typed Table
                                                                                                 6            Name <- c.name + „ <<UDT>>',
         name:String=???                                                                         7            typed <- tt,
                                                                                                 8            method <- meth_seq,
                                                                                          1‟
                                            match(1).name + “_Type”:OR::Structured Type          9            supertype <- if (not c.generalization-> first()->oclIsUndefined()) then
     ownedAttibute
                                                                                                 10                                c.generalization->first().general
                                                                                                 11                               else
                     *          2                                                                12                                OclUndefined
        ???:UML::Property                                         *
                                                                                2‟               13                               endif,
        name:String=??                           match(2).name:OR::Attribute                     14            model <- thisModule.package
        datatype:Datatype=??                     datatype = match(2).datatype                    15            ),
                                                                                                 16      meth_seq : distinct ORDB4ORA!Method foreach
                                                                                                 17                          (op in c.ownedOperation)(Name <- op.name),
                                                                                                 18      tt : ORDB4ORA!TypedTable(
            Each class is mapped to an UDT                                                       19
                                                                                                 20   }
                                                                                                                             Name <- c.name + 's <<PERSISTENT>>')


                   plus a Typed Table                                                            21
                                                                                                 22   rule Property2Attribute {
                                                                                                 23     from
                                                                                                 24       p:UML!Property (not p.isDerived and not p.isMultivalued() and
                                                                                                 25                         p.refImmediateComposite().oclIsTypeOf(UML!Class))
                                                                                                 26     to
                                                                                                 27       a : ORDB4ORA!Attribute(
                                    rule Class2UDT {…}                                           28          Name <- p.name,
                                    rule Property2Attribute {…}                                  29          Type <- p.type,
                                                                                                 30          structured <- p->refImmediateComposite())
                                                                                                 31   }




56                                              Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Putting MDE to work: M2DAT-DB
                                              M2M transformation: Classes and Properties

                                                                                                 1    rule Class2UDT {
        LHS                                               RHS
                                                                                                 2     from
        - UML Class Diagram -                             - OR Model -
                                                                                                 3       c : UML!Class
                                                                                                 4     to
                            1                                                        1‟          5       udt : ORDB4ORA!StructuredType(
         ???:UML::Class                         match(1).name:OR::Typed Table
                                                                                                 6            Name <- c.name + „ <<UDT>>',
         name:String=???                                                                         7            typed <- tt,
                                                                                                 8            method <- meth_seq,
                                                                                          1‟
                                            match(1).name + “_Type”:OR::Structured Type          9            supertype <- if (not c.generalization-> first()->oclIsUndefined()) then
     ownedAttibute
                                                                                                 10                                c.generalization->first().general
                                                                                                 11                               else
                     *          2                                                                12                                OclUndefined
        ???:UML::Property                                         *
                                                                                2‟               13                               endif,
        name:String=??                           match(2).name:OR::Attribute                     14            model <- thisModule.package
        datatype:Datatype=??                     datatype = match(2).datatype                    15            ),
                                                                                                 16      meth_seq : distinct ORDB4ORA!Method foreach
                                                                                                 17                          (op in c.ownedOperation)(Name <- op.name),
                                                                                                 18      tt : ORDB4ORA!TypedTable(
             Each property is mapped to an                                                       19
                                                                                                 20   }
                                                                                                                             Name <- c.name + 's <<PERSISTENT>>')


                  attribute in the UDT                                                           21
                                                                                                 22   rule Property2Attribute {
                                                                                                 23     from
                                                                                                 24       p:UML!Property (not p.isDerived and not p.isMultivalued() and
                                                                                                 25                         p.refImmediateComposite().oclIsTypeOf(UML!Class))
                                                                                                 26     to
                                                                                                 27       a : ORDB4ORA!Attribute(
                                    rule Class2UDT {…}                                           28          Name <- p.name,
                                    rule Property2Attribute {…}                                  29          Type <- p.type,
                                                                                                 30          structured <- p->refImmediateComposite())
                                                                                                 31   }




57                                              Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Putting MDE to work: M2DAT-DB
                     Model to Text Transformation




     PIM                            Conceptual
                                    Data Model
                                                                                                          MIDAS/DB



                                                                                                   MIDAS proposal for
                                                                                                   the content aspect




                                                                                       M2T Transformation
     PSM




                                                                                       ORDB4ORA Model
                    PSM




                        OR                                XML                                 ↓↓↓
                       Model                              Model
                                                                                           SQL Script

                     SQL                                XML
     CODE




                                                       Schema




58          Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Putting MDE to work
                                                             M2DAT-DB Overview



                                                         Conceptual
                                                                                   Model-to-Model Transformations
     PIM




                                                         Data Model
                                                                                               Graph Grammars
                                                                                                      ↓
                                                                                           ATL Mapping Rules (ATL)
                                                                                                      ↓                                   Tree-like Editor
                                                                                            Design Decisions (AMW)                                (EMF)


            Replicate Model Transformation
                  (VIATRA, QVTo, mediniQVT)




                                                         UML2SQL2003
     PSM




                                                                                        M2T Transformation
                                                           PSM




                OR Model            ORA2SQL2003           OR Model                          XML
                                     SQL20032ORA            SQL2003                     ORDB4ORA Model
                                                                                           Model
                                                                                                ↓↓↓
                                                                                                                                             Diagrammer
                                                                                            SQL Script                                             (GMF)
     CODE




                                                                                                      XML
                    SQL                                       SQL                                   Schema




                                               Model-to-Text Transformations                                                            Model Validation
                                                                                                                                             (EVL Files)
                                                             (MOFScript)




59                                            Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Putting MDE to work: M2DAT-DB
                                               Model to Text Transformation

     11 texttransformation codigo (in eco:"http:///ORDB4ORA.ecore") {
     12
     13 eco.Model::main(){
     14    var nombre:String
     15
     16    if (self.Name.size()=0)
     17      nombre="codigo.sql"
     18    else
     19      nombre=self.Name + ".sql"
     20    file (nombre)
     ……………………………………..
     22    //Code Generation for Structured Types
     23    self.datatype->forEach(s:eco.StructuredType)
     24    {
     25               s.generateStructured()
     25               println("")
     27    }
     ……………………………………..
     29   //Code Generation for Reference Types
     30      self.datatype->forEach(r:eco.ReferenceType){
     31        println("CREATE OR REPLACE TYPE " +
     32                        r.Name.replace("<<ref>>", "") +
     33                        " AS OBJECT (ref REF " +
     34                        r.Type.Name.replace("<<udt>>", "") +
     35                        ");n")
     35      }
     191 self.operation->forEach(f:eco.Function)
     192 {
     193       if(f.package = null)
     194              {
     195                print("CREATE OR REPLACE ")
     196                f.generateFunction()
     197              println("")
     198              }
     199 }                                                     MOFScript
     200 }


60                                   Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Putting MDE to work: M2DAT-DB
                                               Model to Text Transformation

     11 texttransformation codigo (in eco:"http:///ORDB4ORA.ecore") {
     12
     13 eco.Model::main(){
     14    var nombre:String
     15
     16    if (self.Name.size()=0)
     17      nombre="codigo.sql"
     18    else
     19      nombre=self.Name + ".sql"
     20    file (nombre)
     ……………………………………..
     22    //Code Generation for Structured Types
     23    self.datatype->forEach(s:eco.StructuredType)
     24
     25
           {
                      s.generateStructured()
                                                                                       For simple rules, we code the
     25               println("")                                                      rule inside the main body
     27    }
     ……………………………………..
     29   //Code Generation for Reference Types
     30      self.datatype->forEach(r:eco.ReferenceType){
     31        println("CREATE OR REPLACE TYPE " +
     32                        r.Name.replace("<<ref>>", "") +
     33                        " AS OBJECT (ref REF " +
     34                        r.Type.Name.replace("<<udt>>", "") +
     35                        ");n")
     35      }
     191 self.operation->forEach(f:eco.Function)
     192 {
     193       if(f.package = null)
     194              {
     195                print("CREATE OR REPLACE ")
     196                f.generateFunction()
     197              println("")
     198              }
     199 }                                                     MOFScript
     200 }


61                                   Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Putting MDE to work: M2DAT-DB
                                               Model to Text Transformation

     11 texttransformation codigo (in eco:"http:///ORDB4ORA.ecore") {
     12
     13 eco.Model::main(){
     14    var nombre:String
     15
     16    if (self.Name.size()=0)
     17      nombre="codigo.sql"
     18    else
     19      nombre=self.Name + ".sql"
     20    file (nombre)
     ……………………………………..
     22    //Code Generation for Structured Types
     23    self.datatype->forEach(s:eco.StructuredType)
     24    {
     25               s.generateStructured()
     25               println("")
     27    }
     ……………………………………..
     29   //Code Generation for Reference Types
     30      self.datatype->forEach(r:eco.ReferenceType){
     31        println("CREATE OR REPLACE TYPE " +
     32                        r.Name.replace("<<ref>>", "") +
     33                        " AS OBJECT (ref REF " +
     34                        r.Type.Name.replace("<<udt>>", "") +
     35                        ");n")
     35      }
     191 self.operation->forEach(f:eco.Function)
     192 {
     193       if(f.package = null)                                                            The complex ones are coded by
     194              {
     195
     196
                        print("CREATE OR REPLACE ")
                        f.generateFunction()
                                                                                               means of auxiliary functions.
     197              println("")
     198              }
     199 }                                                     MOFScript
     200 }


62                                   Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Putting MDE to work: M2DAT-DB
                                               Model to Text Transformation

     11 texttransformation codigo (in eco:"http:///ORDB4ORA.ecore") {
     12
     13 eco.Model::main(){
     14    var nombre:String
     15
     16    if (self.Name.size()=0)
     17      nombre="codigo.sql"
     18    else
     19      nombre=self.Name + ".sql"
     20    file (nombre)
     ……………………………………..
     22    //Code Generation for Structured Types
     23    self.datatype->forEach(s:eco.StructuredType)
     24    {
     25               s.generateStructured()
     25               println("")
     27    }
     ……………………………………..
     29   //Code Generation for Reference Types
     30      self.datatype->forEach(r:eco.ReferenceType){
     31        println("CREATE OR REPLACE TYPE " +
     32                        r.Name.replace("<<ref>>", "") +
     33                        " AS OBJECT (ref REF " +
     34                        r.Type.Name.replace("<<udt>>", "") +
     35                        ");n")
     35      }
     191 self.operation->forEach(f:eco.Function)
     192 {
     193       if(f.package = null)
     194              {
     195                print("CREATE OR REPLACE ")
                                                                                   Those functions are invoked
     196                f.generateFunction()
     197              println("")
                                                                                   from the main body
     198              }
     199 }                                                     MOFScript
     200 }


63                                   Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Putting MDE to work: M2DAT-DB
                                            Model to Text Transformation




 The
 generateStructured
 rule creates the
 Manager and
 Project UDTs                                                                eco.StructuredType::generateStructured() {…}
                            MOFScript                                        self.attribute->forEach(a:eco.Attribute) {…}
                         Code Generation                                     self.datatype->forEach(r:eco.ReferenceType)
                                                                             self.typed->forEach(t:eco.TypedTable){…}
                                                      MOFScript
 Their attributes are
 created in the
                        CREATE OR REPLACE TYPE Manager AS OBJECT (       CREATE OR REPLACE TYPE Project AS OBJECT (
 main body                Cod_Manager
                          Name
                                        VARCHAR2(25),
                                        VARCHAR2(25),
                                                                           Cod_Project
                                                                           Name
                                                                                         VARCHAR2(25),
                                                                                         VARCHAR2(25),
                          Address       Address_Type,                      plans         NT_Plans,
                          manage        REF_Project                        managed_by    REF_Manager)
                          Telephone     VARCHAR2(25))                    /
                        /
                                                                         CREATE OR REPLACE TYPE Ref_Project AS OBJECT (
                        CREATE OR REPLACE TYPE Ref_Manager AS OBJECT (     ref REF Project)
                          ref REF Manager)                               /
                        /
                                                                         CREATE TABLE Projects OF Project
                        CREATE TABLE Managers OF Manager;                 NESTED TABLE plans STORE AS Plans_List;




64                               Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Putting MDE to work: M2DAT-DB
                                            Model to Text Transformation




 As well, the REF
 types are created in
 the main body
                                                                             eco.StructuredType::generateStructured() {…}
                            MOFScript                                        self.attribute->forEach(a:eco.Attribute) {…}
                         Code Generation                                     self.datatype->forEach(r:eco.ReferenceType)
                                                                             self.typed->forEach(t:eco.TypedTable){…}
                                                      MOFScript



                        CREATE OR REPLACE TYPE Manager AS OBJECT (       CREATE OR REPLACE TYPE Project AS OBJECT (
                          Cod_Manager   VARCHAR2(25),                      Cod_Project   VARCHAR2(25),
                          Name          VARCHAR2(25),                      Name          VARCHAR2(25),
                          Address       Address_Type,                      plans         NT_Plans,
                          manage        REF_Project                        managed_by    REF_Manager)
                          Telephone     VARCHAR2(25))                    /
                        /
                                                                         CREATE OR REPLACE TYPE Ref_Project AS OBJECT (
                        CREATE OR REPLACE TYPE Ref_Manager AS OBJECT (     ref REF Project)
                          ref REF Manager)                               /
                        /
                                                                         CREATE TABLE Projects OF Project
                        CREATE TABLE Managers OF Manager;                 NESTED TABLE plans STORE AS Plans_List;




65                               Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Putting MDE to work: M2DAT-DB
                                        Model to Text Transformation




 The Tabled Types are
 also created in the
 main body
                                                                         eco.StructuredType::generateStructured() {…}
                        MOFScript                                        self.attribute->forEach(a:eco.Attribute) {…}
                     Code Generation                                     self.datatype->forEach(r:eco.ReferenceType)
                                                                         self.typed->forEach(t:eco.TypedTable){…}
                                                  MOFScript



                    CREATE OR REPLACE TYPE Manager AS OBJECT (       CREATE OR REPLACE TYPE Project AS OBJECT (
                      Cod_Manager   VARCHAR2(25),                      Cod_Project   VARCHAR2(25),
                      Name          VARCHAR2(25),                      Name          VARCHAR2(25),
                      Address       Address_Type,                      plans         NT_Plans,
                      manage        REF_Project                        managed_by    REF_Manager)
                      Telephone     VARCHAR2(25))                    /
                    /
                                                                     CREATE OR REPLACE TYPE Ref_Project AS OBJECT (
                    CREATE OR REPLACE TYPE Ref_Manager AS OBJECT (     ref REF Project)
                      ref REF Manager)                               /
                    /
                                                                     CREATE TABLE Projects OF Project
                    CREATE TABLE Managers OF Manager;                 NESTED TABLE plans STORE AS Plans_List;




66                           Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Putting MDE to work: M2DAT-DB
                                     M2DAT-DB Web site

     • More info at
       M2DAT-DB Web
       site
       – Videos
       – Case Studies
       – User Manual
       – Download


                                            http://m2datdb.wordpress.com




67                   Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Agenda


     Motivation


     (Meta)Modeling


     MDA


     Putting MDE to work


     Conclusion


68    Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Conclusion
                                                      Adopting MDE …
         Based on sound and time-proven                                              Benefits of adopting MDE
                      principles                                               Ease of platform migration
      Higher levels of abstraction                                            Reqs traceability until working-code
      Higher levels of automation                                             Automation + Reutilization =
      Higher levels of standardization                                                                    ↑ Productivity

                                 But …. the use of MDE is still an exception
                        Cultural and economic hurdles hampering MDE adoption
           — Tools: very few, poor usability, lack of interoperability
           — Cultural change: Software developers  Sofware Modellers
           — Incorrectly associated to heavy-weight methodologies
           — Initial adoption costs

                                               … and develop tools for
                      No silver-bullet             it (e.g., Web-based                Mappings play a cornerstone role
                                                              systems)
        “No manual coding” is not 100% achievable in                             Models become your CORPORATE ASSETS
         general                                                                  Use mappings between the models for …
        Need to identify the domains in which MDE can                             refinements, abstractions, migrations …
         be effectively used


69                                    Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Conclusion
                                         Some reflections

     • ¿De verdad crees que funciona esto del MDE?
        – ¿Seremos capaces de generar código a partir de modelos, incluso cuando
          todavía no estamos de acuerdo ni en cómo representar el
          comportamiento?
        – ¿Sinceramente, tu crees en eso de pintar dos cajas y tres líneas y obtener
          todo el código de tu aplicación?
       MDE compensa a medio plazo                                     Desarrollo Industrial de Software




70                       Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Credits & Acknowledgements

     A number of slides in this presentation have been adapted from the
                          following previous works

     • [Bézivin 2006] → Introduction to Model Engineering, Jean Bézivin. OpenCourseWare.
     • [Paige 2006] → The Meta-Object Facility (MOF), Richard Paige. OpenCourseWare.
     • [Barbero, Didonet Del Fabro 2007] → Practice of Model Transformation and Model
       Weaving in the Eclipse Modeling Project with ATL and AMW, Mikael Barbero & Marcos
       Didonet Del Fabro. Tutorial at TOOLS Europe 2007.
     • [Selic 2008] → Opportunities in the Domain of Model-Driven Development, Bran Selic.
       Guest Talk at JISBD’2008.
     • [Vallecillo 2008] → A Journey through the Secret Life of Models. A. Vallecillo. Daghstul
       Seminars: Perspectives Workshop: Model Engineering of Complex Systems.
     • [Bézivin 2009] → Advances in Model Driven Engineering: Achievements and Challenges,
       Jean Bézivin. Guest Talk at JISBD’2009.

                                                                                    … thanks to all of them


71                        Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
Gestión Avanzada de Datos
            @Santander – 21 July, 2011



          Model-Driven Engineering:
a first glance at a ¿new? way of conceiving
            software development


               Juan M. Vara
                juanmanuel.vara@urjc.es


           Kybele Research Group
          University Rey Juan Carlos
               (Madrid - Spain)

More Related Content

PDF
Eight deadly defects in systems engineering and how to fix them
PDF
[2015/2016] Software systems engineering PRINCIPLES
PPT
Systems Engineering - a smarter way
PPTX
Software engineering principles in system software design
PDF
SADT & IDEF0 for Augmenting UML, Algile & Usability Engineering
PDF
Modelling the User Interface
PDF
Chapter 2 software_development_life_cycle_models
PPT
Web technologies: Model Driven Engineering
Eight deadly defects in systems engineering and how to fix them
[2015/2016] Software systems engineering PRINCIPLES
Systems Engineering - a smarter way
Software engineering principles in system software design
SADT & IDEF0 for Augmenting UML, Algile & Usability Engineering
Modelling the User Interface
Chapter 2 software_development_life_cycle_models
Web technologies: Model Driven Engineering

What's hot (18)

PDF
Analyze your software assets with Modisco par Frédéric Madiot
PDF
7 5-94-101
PDF
Context-Oriented Programming
PDF
Detailed design: Nailing it Down
PDF
Software Architecture: Design Decisions
PPT
Animated Transitions between User Interface Views
PDF
V Code And V Data Illustrating A New Framework For Supporting The Video Annot...
PPT
Unit4
PDF
Software Architecture by Reuse, Composition and Customization
PDF
Lecture 1 Software Engineering and Design Introduction
PDF
Daniel.dvorak
PDF
Information System Development
PDF
Exploration Production Portals
PDF
Third Serenoa Newsletter
PPTX
System engineering
PPT
On the Composition and Reuse of Viewpoints
PDF
Action-Driven Design of User Interfaces
PDF
Modeling: the holy grail for designing complex systems?
Analyze your software assets with Modisco par Frédéric Madiot
7 5-94-101
Context-Oriented Programming
Detailed design: Nailing it Down
Software Architecture: Design Decisions
Animated Transitions between User Interface Views
V Code And V Data Illustrating A New Framework For Supporting The Video Annot...
Unit4
Software Architecture by Reuse, Composition and Customization
Lecture 1 Software Engineering and Design Introduction
Daniel.dvorak
Information System Development
Exploration Production Portals
Third Serenoa Newsletter
System engineering
On the Composition and Reuse of Viewpoints
Action-Driven Design of User Interfaces
Modeling: the holy grail for designing complex systems?
Ad

Viewers also liked (11)

PPTX
Scrum i+d. Agile and nanotechnology, research and development
PDF
James Christie CAST 2014 Standards – promoting quality or restricting competi...
PPTX
Cas 2011 Integración continua vs controlada
PPTX
Mob Programming
PPTX
Technical Debt
PDF
Mob Programming
KEY
The Technical Debt Trap - Michael "Doc" Norton
PDF
5 Arguments Against Kanban
PPTX
Managing Technical Debt
PDF
Agile Maintenance
PDF
Managing technical debt
Scrum i+d. Agile and nanotechnology, research and development
James Christie CAST 2014 Standards – promoting quality or restricting competi...
Cas 2011 Integración continua vs controlada
Mob Programming
Technical Debt
Mob Programming
The Technical Debt Trap - Michael "Doc" Norton
5 Arguments Against Kanban
Managing Technical Debt
Agile Maintenance
Managing technical debt
Ad

Similar to MDE first glance (20)

PPSX
Software engineering
PDF
software engineering notes for cse/it fifth semester
PDF
Software engineering note
PPT
04 designing architectures
PPT
Cs 1023 lec 4 (week 1)
PPTX
1-SUMSEM2024-25_CSI3014_TH_VL2024250700241_2025-05-13_Reference-Material-I.pptx
PPTX
Software Engineering- Crisis and Process Models
PDF
Model driven process for real time embedded
PPTX
A New Software Engineeering Approach
PPTX
SDA 01.pptx
PDF
Devnology back toschool software reengineering
PPTX
20CS4103 SE UNIT 1-1.pptx software engineering
PDF
Managing Agile Software Development Projects
PPTX
Software Engineering PPT Unit I.pptx
PPTX
Introduction to Software Reverse Engineering
PDF
ccs356-software-engineering-notes.pdf
PDF
Software lifecycle model report
PPTX
Software Engineering and Traditional Software development models
PPT
Pressman ch-3-prescriptive-process-models
PPT
Waterfall model
Software engineering
software engineering notes for cse/it fifth semester
Software engineering note
04 designing architectures
Cs 1023 lec 4 (week 1)
1-SUMSEM2024-25_CSI3014_TH_VL2024250700241_2025-05-13_Reference-Material-I.pptx
Software Engineering- Crisis and Process Models
Model driven process for real time embedded
A New Software Engineeering Approach
SDA 01.pptx
Devnology back toschool software reengineering
20CS4103 SE UNIT 1-1.pptx software engineering
Managing Agile Software Development Projects
Software Engineering PPT Unit I.pptx
Introduction to Software Reverse Engineering
ccs356-software-engineering-notes.pdf
Software lifecycle model report
Software Engineering and Traditional Software development models
Pressman ch-3-prescriptive-process-models
Waterfall model

Recently uploaded (20)

PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Cell Structure & Organelles in detailed.
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PPTX
Institutional Correction lecture only . . .
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
master seminar digital applications in india
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Classroom Observation Tools for Teachers
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
01-Introduction-to-Information-Management.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
102 student loan defaulters named and shamed – Is someone you know on the list?
Cell Structure & Organelles in detailed.
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Institutional Correction lecture only . . .
Supply Chain Operations Speaking Notes -ICLT Program
Microbial diseases, their pathogenesis and prophylaxis
Microbial disease of the cardiovascular and lymphatic systems
master seminar digital applications in india
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
2.FourierTransform-ShortQuestionswithAnswers.pdf
Classroom Observation Tools for Teachers
TR - Agricultural Crops Production NC III.pdf
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Complications of Minimal Access Surgery at WLH
Final Presentation General Medicine 03-08-2024.pptx
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
01-Introduction-to-Information-Management.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf

MDE first glance

  • 1. Gestión Avanzada de Datos @Santander – 21 July, 2011 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development Juan M. Vara juanmanuel.vara@urjc.es Kybele Research Group University Rey Juan Carlos (Madrid - Spain)
  • 2. Agenda Motivation (Meta)Modeling MDA Putting MDE to work Conclusion 2 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 3. Motivation Software Complexity • Many modern software systems are reaching levels of complexity encountered in biological systems – Systems of systems each of which may include of millions of lines of code – … any one of which might be the culprit that brings down the entire system Mariner (1962) • 18.5$ millions • Programmer incorrectly transcribed a handwritten formula (period instead of comma in FORTRAN loop) • Furthermore, we can only see an increase in complexity of software systems due to: – Growing demand for greater and more sophisticated functionality • Given our current track record, how will we cope with this rise in complexity? 3 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 4. Motivation Software Complexity Essential Accidental First, distinguising what can be simplified Complexity Complexity • Essential complexity: we have a hard problem – Inherent to the problem – Cannot be sidestepped or eliminated by technology or method – E.g., geospatial applications are inherently more “complex” than standard “forms over data” applications • Accidental complexity: we have made a problem hard – Due to the use of inappropriate technologies or methods – It happens because someone didn't find the simplest way to implement a specified set of features – Might be eliminated by good design, or good redesign. – E.g., banks legacy systems programmed in COBOL 4 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 5. Motivation Software Complexity Modern software development suffers from an excess of accidental complexity How can we deal with this rise in complexity? 5 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 6. Motivation Software Complexity Can you see the underlying structure??? 6 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 7. Motivation Software Complexity Can you see the underlying structure??? Much better, isn’t it??? 7 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 8. Motivation Software Complexity Clearly, models help on simplifying software development by raising the level of abstraction at which software is conceived 8 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 9. Motivation Modeling in other disciplines • Modeling has been widely used in Engineering – Whith specification purposes  Structure and behavior Architecture  Interacting with stakeholders – For reasoning about the Avionics system  Detecting design errors  Infer and test properties  Prototyping (simulation) – As a guide towards implementation … 9 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 10. Motivation What happens with models in Software Engineering?? Used (at best) with documentation purposes There is a big gap between the models and the underlying implementation Models are not No way of ensuring No tools or updated with design programmers followed the changes made by design decissions captured in languages to programmers models handle models Are we really doing Software Engineering?? 10 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 11. Motivation Let’s put models to work in Software Engineering The Remarkable Thing About Software “Software has the rare property that it allows us to directly evolve models into full-fledged implementations without changing the engineering medium, tools, or methods” [John Hogg, 2003] Registrar Pago Seleccionar Imágenes Guardar Resultado Mostrar Resultados (SIW) LAIM Validar Usuario <<WS>> Del Procesamiento Validar Tarjeta Recibir Criterios de Crédito de Búsqueda Imágenes Criterios <<WS>> SACim Recibir Imágenes <<WS>> Obtener Imágenes Resultados Imágenes Imágenes Obtenidos <<<WS>> SPim “from (models) human-readable to Realizar Procesamiento de Imágenes Registrar Pago Seleccionar Imágenes Mostrar Resultados Guardar Resultado computer-understandable” (SIW) LAIM Validar Usuario Del Procesamiento Validar Tarjeta de Crédito Recibir Criterios Imágenes de Búsqueda Criterios [J. Bézivin] Recibir Imágenes SACim Obtener Imágenes Resultados Imágenes Imágenes Obtenidos SPim Realizar Procesamiento de Imágenes 11 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 12. Motivation Model-Driven Engineering (and related disciplines) MDA DSL ADM Boost the role of models and modelling activities at the MIC MDSD different steps of the MSE development cycle FROM CODING to MODELLING Model-Driven Component-based Engineering Software Engineering Structured Programming Object-Oriented Aspect-Oriented Programming Programming Assembly Raising the abstraction Languages level in Software Development 12 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 13. Motivation Model-Driven Engineering (and related disciplines) MDA DSL ADM Boost the role of models and modelling activities at the MIC MDSD different steps of the MSE development cycle ROLE CODING to FROM of LEVEL of MODELLING MODELS AUTOMATION Model-Driven Component-based Engineering Software Engineering Structured Programming Object-Oriented Aspect-Oriented Programming Programming Assembly Raising the abstraction Languages level in Software Development 13 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 14. Agenda Motivation (Meta)Modeling MDA Putting MDE to work Conclusion 14 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 15. Modeling What’s in a model? • What is a model? – A model is a simplification of a system built with an intended goal in mind. – A model is a description of a system written in a well-defined language  It should be able to answer questions in place of the actual system  It allows us to use something that is simpler, safer or cheaper than reality instead of reality for some purpose.  Thus, it allows us to deal with the world in a simplified manner, avoiding the complexity, danger and irreversibility of reality  A model represents reality for the given purpose; the model is an abstraction of reality in the sense that it cannot represent all aspects of reality 15 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 16. Modeling What’s in a model? • A model is the simplified image of a system – MDE is recent but the idea of modeling is old System repOf Model – Plato (427-347 before JC), in Timeus compares vertebras to door hinges (74a) or blood vessels to irrigation channels 16 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 17. Modelling How are models understood, interpreted, defined … ?? Every map has a legend (implicit or explicit) We cannot “get” the map without its legend The legend is the metamodel 17 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 18. Modelling How are models understood, interpreted, defined … ?? Every map has a legend (implicit or explicit) A model has no meaning when separated from its metamodel, We cannot “get” the that acts asitsthe filter for the map without legend reality to be modelled The legend is the metamodel 18 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 19. Modelling Metamodels act as filters for reality A (very simplistic ) metamodel for modelling Meetings 19 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 20. Modelling Metamodels act as filters for reality 20 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 21. Modelling The OMG modelling stack (abstract) A metamodel is the model of a modelling language: it makes statements about what can be expressed in the valid models of a certain modelling language. Metamodel c2 Terminology c2 Assertions Model (Terminal Model) 21 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 22. Modelling The OMG modelling stack (abstract) c2 Metamodel c2 Metamodel Being a model, a c2 metamodel has to conform to its c2 corresponding Model metamodel (Terminal Model) 22 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 23. Modelling The OMG modelling stack (abstract) c2 c2 Metamodel Metametamodel c2 Metamodel The metamodel might be expressed c2 using the same c2 modelling language Model that it defines. (Terminal Model) Then it’s called metametamodel 23 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 24. Modelling Don't confuse the model and the system • Principle of limited substitutability. – A model M is said to be a representation of a system S for a given set of questions Q if, for each question of this set Q, the model M will provide exactly the same answer that the system S would have provided in answering the same question. e.g. the globe is a model of the earth …. What is the temperature at the bottom if I dig a 100 km deep hole at the surface of the earth ? repOf … allowing to ask certain questions … Could I travel from Paris to New York without using a boat or a plane? … but not others … 24 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 25. Modelling Aspects of a system represented by models Ma Mb A given system may M1 Mc have plenty of different models Each model isRepresentedBy represents a given aspect of the system M0 S 25 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 26. Modelling Different Models ↔ Different Languages Plumber's Electrician's view view Architect's view Decorator's Carpenter's view view Phone Installer's view 26 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 27. Modelling Domain Specific Languages (DSLs) • Domain Specific Languages (DSLs) are SELECT soh.[SalesOrderID] languages tailored to a specific ,soh.[OrderDate] ,soh.[ShipDate] application domain ,sod.[ProductID] ,sod.[OrderQty] ,sod.[UnitPrice] – They offer substantial gains in expressiveness ,soh.[CustomerID] FROM [Sales].[SalesOrderHeader] AS soh and ease of use compared with general- JOIN [Sales].[SalesOrderDetail] AS sod ON soh.[SalesOrderID] = purpose programming languages in their sod.[SalesOrderID] WHERE soh.[CustomerID] = 29559; domain of application – Higher-level abstraction than general purpose languages – Closer to the problem domain than to the implementation domain – Closer to domain experts Metamodels define (partially) Domain Specific Languages (DSLs) 27 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 28. Modelling Abstract syntax VS Concrete Syntax Speaker(Mary) Attendant(John) Attendant(Peter) Chair(c1) Chair(c2) Same Model Same Abstractions sat_on(John, c1) Different notations Different syntaxes sat_on(Peter, c2) 28 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 29. Modelling Abstract Syntax VS Concrete Syntax Abstract Syntax • There are two types of objects: Furniture and Person • In turn, each Furniture object could be a Chair or a Desk and each Person an Attendant or a Speaker • Each Person can be sat on one (and only one) piece of Furniture Concrete Syntax – A box represents each Furniture or Person object – The name of the object is included into an inner box – Each occurrence of the relationship between Furniture and Person objects is represented by an arrow pointing to the Person object 29 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 30. Modelling Abstract Syntax VS Concrete Syntax Abstract Syntax • There are two types of objects: Furniture and Person • In turn, each Furniture object could be a Chair or a Desk and each Person an Attendant or a Speaker • Each Person can be sat on one (and only one) piece of Furniture (Another) Concrete Syntax Speaker(Mary) – Each object is represented by the reserved word Attendant(John) that designates the type of the object plus the name Attendant(Peter) of the object between brackets Chair(c1) – Each occurrence of the sat_on relationship is represented by the reserved work sat_on plus the Chair(c2) name of the objects between brackets and sat_on(John, c1) separated by commas sat_on(John, c2) 30 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 31. Agenda Motivation (Meta)Modeling MDA Putting MDE to work Conclusion 31 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 32. MDA A way of doing MDE Sometimes MDA is referred to as “MDE with standards” Role of models MDE principles Automation Standards to formalize Categorization of MDE principles Abstraction Levels QVT OCL SPEM KDM … 32 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 33. MDA Categorization of Abstraction Levels: CIM CIM •Computer Independent Model • System requirements are modelled by Computer PIM •Platform Independent Model PSM Independent Models (CIMs) CODE •Platform Specific Model •Running system – The CIM model is a view of the business processes – … ellaborated by domain experts – … is not always mandatory, it depends on the specific domain addressed Requirements Model (use case and activity diagrams) • … serve as a bridge between domain experts and business analysts 33 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 34. MDA Categorization of Abstraction Levels: PIM CIM •Computer Independent Model • The PIM models the system without considering PIM •Platform Independent Model PSM specific platform technological details CODE •Platform Specific Model •Running system – … allows the mapping to any technological platform – … think of a neutral virtual machine where each operation will be later implemented in the targetted platform – … is always mandatory and may result into one or more PSMs CIM Huge gap between CIM and PIM levels Requirements Model ↓ (use case and activity diagrams) Traces at best PIM <<Interface>> PaymentFe addPayment() cancelPayment() getPayments() getPaymentActivity() updatePayment() <<Interface>> PaymentFeExtended addPaymentNoteExtended() completePaymentExtended() failPaymentExtended() getPaymentsExtended() pendPaymentExtended() <<Interface>> PaymentUtility prepare() getRouting() checkForDuplicate() : Consumer 1. Create payment : ConsumerFrontEnd 1.1. Enter payment : XmlConnector : PaymentService Sequence Diagram: InteliWorks Consumer: Payment Realizations / Consumer: Payment - Enter : FinancialTransactionService resubmitPaymentExtended() 1.2. Display confirmation CreationData FinancialTransactionBase reversePaymentExtended() +creationData 1 <<Interface>> <<Interface>> Sequence Diagram: InteliWorks PaymentEvent 2. Ok Consumer: Financial Transaction Payment Realizations / Consumer: Financial FinancialTransactionConsumerData +displayStatus DisplayStatus processPayments() 2.1. addPaymentRq handlePayeeChange() Transaction - Add 1 1 2.1.1. addPayment( ) 2.1.1.1. addFinancialTransaction( ) FinancialTransactionData +processingData ProcessingData 2.1.1.1.1. financialTransaction 1 1 Notification FinancialTransactionCommon 0..1 (from eMessenger) PaymentService (from Financial Transaction Service) +status 1 2.1.1.2. payment <<enumeration>> FinancialTransactionTypeCode FinancialTransaction FinancialTransactionExtended ProcessingStatus PAYMENT FUNDS_TRANSFER 2.1.2. addPaymentRs 0..1 0..1 0..1 +status 1 FinancialTransactionUtility 1 +transactionType +previousStep SchedulingEvent (from Financial Transaction Service) 0..1 1 +specification * +note * (from Scheduler) {ordered} +amount CurrencyAmount FinancialTransactionSpecification Note ProcessingStep 3. Close view Sequence Diagram: InteliWorks 1 0..1 3.1. View payments Consumer: Payment Realizations / FinancialTransaction Consumer: Payment - View Payments (from Financial Transaction Service) PayeeUtility AccountUtility OperationalDirectory (from Operational Directory Service) PaymentRead FinancialTransactionRead FinancialTransactionWrite Navigation Maps User Interface Conceptual Data Model (Class diagrams + Activity diagrams) (Sequence diagrams) (E/R diagrams) 34 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 35. MDA Categorization of Abstraction Levels: PSM (& Code) • Specifications described in the PIMs are adapted to specific CIM •Computer Independent Model PIM •Platform Independent Model platforms by means of Platform Specific Models (PSMs) from which PSM •Platform Specific Model the code is automatically generated CODE •Running system PIM <<Interface>> PaymentFe addPayment() cancelPayment() getPayments() getPaymentActivity() updatePayment() <<Interface>> PaymentFeExtended addPaymentNoteExtended() completePaymentExtended() failPaymentExtended() getPaymentsExtended() pendPaymentExtended() <<Interface>> PaymentUtility prepare() getRouting() checkForDuplicate() : Consumer 1. Create payment : ConsumerFrontEnd 1.1. Enter payment : XmlConnector : PaymentService Sequence Diagram: InteliWorks Consumer: Payment Realizations / Consumer: Payment - Enter : FinancialTransactionService resubmitPaymentExtended() 1.2. Display confirmation CreationData FinancialTransactionBase reversePaymentExtended() +creationData 1 <<Interface>> <<Interface>> Sequence Diagram: InteliWorks PaymentEvent 2. Ok Consumer: Financial Transaction Payment Realizations / Consumer: Financial FinancialTransactionConsumerData +displayStatus DisplayStatus processPayments() 2.1. addPaymentRq handlePayeeChange() Transaction - Add 1 1 2.1.1. addPayment( ) 2.1.1.1. addFinancialTransaction( ) FinancialTransactionData +processingData ProcessingData 2.1.1.1.1. financialTransaction 1 1 Notification FinancialTransactionCommon 0..1 (from eMessenger) PaymentService (from Financial Transaction Service) +status 1 2.1.1.2. payment <<enumeration>> FinancialTransactionTypeCode FinancialTransaction FinancialTransactionExtended ProcessingStatus PAYMENT FUNDS_TRANSFER 2.1.2. addPaymentRs 0..1 0..1 0..1 +status 1 FinancialTransactionUtility 1 +transactionType +previousStep SchedulingEvent (from Financial Transaction Service) 0..1 1 +specification * +note * (from Scheduler) {ordered} +amount CurrencyAmount FinancialTransactionSpecification Note ProcessingStep 3. Close view Sequence Diagram: InteliWorks 1 0..1 3.1. View payments Consumer: Payment Realizations / FinancialTransaction Consumer: Payment - View Payments (from Financial Transaction Service) PayeeUtility AccountUtility OperationalDirectory (from Operational Directory Service) PaymentRead FinancialTransactionRead FinancialTransactionWrite Navigation Maps User Interface Conceptual Data Model (Class diagrams + Activity diagrams) (Sequence diagrams) (E/R diagrams) AUTOMATION PSM xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx AUDIT_ID : NUMBER(9, 0) FINANCIAL_T RANSACTIONS ACTION_CODE : NUMBER(9, 0) FI_TRANSACTION_SEQ_ID : NUMBER(9, 0) LAST_MODIFIED_BY : NUMBER(9, 0) CONSUMER_SEQ_ID : NUMBER(9, 0) TRANSACT ION_TYPE : NUMBER(9, 0) MODEL_INST ANCE_NUMBER : NUMBER(9, 0) RECURRING_MODEL_SEQ_ID : NUMBER(9, 0) SOURCE_ACCOUNT _SEQ_ID : NUMBER(9, 0) SOURCE_ACCOUNT _T YPE_CODE : NUMBER(9, 0) AUDIT_ID : NUMBER(9, 0) ACTION_CODE : NUMBER(9, 0) BILL_SEQ_ID : NUMBER(9, 0) PROVIDER_SEQ_ID : NUMBER(9, 0) PAYEE_NAME : VARCHAR2(255) PAYMENTS FI_TRANSACTION_SEQ_ID : NUMBER(9, 0) PAYEE_SEQ_ID : NUMBER(9, 0) PAYEE_PHONE_NUMBER : VARCHAR2(32) NAME_ON_ACCOUNT : VARCHAR2(255) BILLING_ACCOUNT : VARCHAR2(255) xxxxxxxxxxxx xxxxxxxxxxxx xxxxxxxxxxxx SOURCE_ACCOUNT _NUMBER : VARCHAR2(32) SOURCE_ROUT ING_NUMBER : VARCHAR2(9) SOURCE_ACCOUNT _HOLDER : VARCHAR2(255) PAYMENT_DESTINAT ION_TYPE : NUMBER(9, 0) ADDRESS1 : VARCHAR2(64) ADDRESS2 : VARCHAR2(64) xxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxx REQUESTED_DAT E : DATE REQUESTED_SCHEDULE_TYPE : NUMBER(9, 0) ADDRESS3 : VARCHAR2(64) ADDRESS4 : VARCHAR2(64) CREDIT_DATE : DATE CITY : VARCHAR2(32) xxxxxxxxxxxxx xxxxxxxxxxxxx xxxxxxxxxxxxx PROCESS_DAT E : DATE DISPLAY_STAT US_CODE : NUMBER(9, 0) ST ATE_PROV : VARCHAR2(32) POSTAL_CODE : VARCHAR2(11) CURRENCY_CODE : CHAR(3) COUNT RY_CODE : CHAR(3) xxxxxxxxxxx xxxxxxxxxxx xxxxxxxxxxx AMOUNT : NUMBER(17, 2) CONSUMER_MEMO : VARCHAR2(255) ACT_PAYEE_NAME : VARCHAR2(255) REMITTANCE_METHOD : NUMBER(9, 0) DISPLAY_STAT US_MODIFIED_DAT E : DATE ACT_PAYEE_PHONE_NUMBER : VARCHAR2(32) xxxxxxxxxxxxxx xxxxxxxxxxxxxx xxxxxxxxxxxxxx DISPLAY_STAT US_MODIFIED_BY : NUMBER(9, 0) DISPLAY_STAT US_NOT E : VARCHAR2(255) ACT_NAME_ON_ACCOUNT : VARCHAR2(255) ACT_BILLING_ACCOUNT : VARCHAR2(255) PROCESSING_FLOW_TYPE : NUMBER(9, 0) ACT_PAYMENT _DEST INATION_TYPE : NUMBER(9, 0) xxxxxxxxxxxxx xxxxxxxxxxxxx xxxxxxxxxxxxx PROCESSING_TIME : DATE RETRY_COUNT : NUMBER(9, 0) ACT_ADDRESS1 : VARCHAR2(64) ACT_ADDRESS2 : VARCHAR2(64) xxxxxxxxx xxxxxxxxx xxxxxxxxx DESTINATION_PROVIDER_SEQ_ID : NUMBER(9, 0) PROCESS_STATUS_CODE : NUMBER(9, 0) AUTHORIZAT ION_PROVIDER_SEQ_ID : NUMBER(9, 0) ACT_ADDRESS3 : VARCHAR2(64) ACT_ADDRESS4 : VARCHAR2(64) ACT_CITY : VARCHAR2(32) xxxxxxxxx xxxxxxxxx xxxxxxxxx DAYS_TO_CREDIT : NUMBER(9, 0) SOURCE_PROVIDER_SEQ_ID : NUMBER(9, 0) VALIDATE_STATUS_CODE : NUMBER(9, 0) ACT_STATE_PROV : VARCHAR2(32) ACT_POST AL_CODE : VARCHAR2(11) ACT_COUNTRY_CODE : CHAR(3) xxxxxxx xxxxxxx xxxxxxx PROCESS_STATUS_PROVIDER_SEQ_ID : NUMBER(9, 0) PROCESS_STATUS_MODIFIED_BY : NUMBER(9, 0) PROCESS_STATUS_MODIFIED_DATE : DAT E CHECK_NUMBER : VARCHAR2(40) ACT_REMITT ANCE_METHOD : NUMBER(9, 0) SERVICE_CENT ER_SEQ_ID : NUMBER(9, 0) xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx PROCESS_STATUS_NOTE : VARCHAR2(255) VALIDATE_STATUS_MODIFIED_BY : NUMBER(9, 0) VALIDATE_STATUS_MODIFIED_DATE : DAT E MERCHANT _SEQ_ID : NUMBER(9, 0) DEFAULT _ROUTING_REASON : NUMBER(9, 0) DAYS_TO_PROCESS : NUMBER(9, 0) xxxxxxx xxxxxxx xxxxxxx AUDIT_DAT E : DATE AUDIT_VERSION : NUMBER(9, 0) VALIDATE_STATUS_NOTE : VARCHAR2(255) AUDIT_VERSION : NUMBER(9, 0) AUDIT_GENERATION : NUMBER(9, 0) AUDIT_DAT E : DATE ]xxxx ]xxxx ]xxxx AUDIT_GENERATION : NUMBER(9, 0) Interface Code Web Services Code Value Object Code Database Design Model (EJB) (WSDL/SOAP) (Java) (class diagram) WORKING CODE 35 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 36. MDA Model Transformations • Model Transformations are the key to automate any model-driven development process Two conceptions though they are just one indeed  M2M M2T model-to-model model-to-text transformations transformations (… aka code generation or model serialization) CREATE TYPE cast_type AS ( id INTEGER(25), casting_order INTEGER, role CHARACTER VARYING(25), actor Ref _actor_type, movie Ref _movie_type ); CREATE TABLE casts OF cast_type ( id PRIMARY KEY, role NOT_NULL, actor NOT NULL ); CREATE TYPE Ref _cast_type AS ( ref REF cast_type ); 36 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 37. MDA Model Transformations conforms to Metametamodel Model transformations Class as Class transformation models MMt Class MMa Rule Class MMb Class Pink Green Class Class Red MMa2MMb Rule Blue G2P Rule R2B Ma Mb 37 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 38. MDE The Unified Modelling Language • UML (Unified Modelling Language) – A GPL modelling language for specifying sofware systems  Mainly object-oriented – Aims at being a universal modelling standard Several types of diagrams for specific purposes 38 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 39. MDA MOF: Stages in the Evolution of Languages at the OMG. How has MOF (a) (b) (c) come to be? MOF MOF UML UML UML SPEM CWM QVT etc. aUML aUML aUML anSPEM aCWM a QVT a… Model Model model model model model model 39 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 40. MDA Meta-Object Facility • A metadata management framework. – It is an OMG-standard metamodelling language. – A language to be used for defining languages or … – A DSL for defining new DSLs  Simplified MOF Metamodel 40 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 41. MDA XML Metadata Interchange • An XML-based standard for sharing meta-data – A set of rules to generate XML Schemas for MOF based metamodels. – A Schema for UML The most popular – A Schema for MOF – A set of rules to generate XML documents from instances of MOF models Meta-Metamodel MOF conforms to It is quite rare to find two different tools using the UML XMI Schema same XMI Metamodel (UML) version!!! OMG's Model XMI An UML model (m) Document Interchange Working Group 41 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 42. MDA UML Profiles • UML provides a lightweight extension mechanism – A UML profile is a modelling package containing modelling elements customized for a specific purpose or domain – Such new elements are defined by extending existing ones  By combining stereotypes, tagged values, and constraints <<profile>> XMLSchema MySchema << stereotype >> nameSpace: KYB_MYXSD XML Complex Type << metaclass >> nameSpace: String Class << XML Complex Type >> Person_Type << stereotype >> XML Element <<apply>> compositor: Sequence << metaclass >> << Complex Content >> Association << stereotype >> << Complex Content >> Complex Content << enumeration >> compositor: CompositorType << XML Element >> CompositorType NAME << XML Element >> All NIF Choice Sequence 42 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 43. MDA UML Profiles – Defining new DSLs How has MOF (a) (b) (c) come to be? MOF MOF UML UML UML SPEM CWM QVT UML profile for XSD aUML aUML aUML anSPEM aCWM a QVT a XSD Model Model model model model model model 43 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 44. MDA Common Warehouse metamodel - CWM • OMG specification for modeling metadata – Related to development of data warehouses • Representation of data structures according to different technologies – Relational, multidimensional, XML, flat files, etc. • CWM models enable users to trace the lineage of data – Where are data come from? – When were data created? – How were data created? 44 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 45. MDA Common Warehouse metamodel - CWM Management Warehouse Warehouse Process Operation Analysis Transformation OLAP Data Information Business Mining Visualization Nomenclature Resource Object Multi Relational Record XML (UML) Dimensional Foundation Business Data Expressions Keys Type Software Information Types Index Mapping Deployment UML 2.0 (Foundation, Behavioral_Elements, Model_Management) 45 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 46. MDA Common Warehouse metamodel - CWM MOF • Excerpt of relational metamodel 46 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 47. MDA Next steps??? MDA ↔ ADM • Architecture Driven Modernization – Process of understanding and evolving existing software assets for the purpose of  Improvement ADM is another OMG initiative intended to be  Refactoring the reverse of MDA: MDA covering forward engineering while ADM covers  Reuse also backward engineering  Migration into another language  Service-oriented architecture … PIM KDM a common intermediate representation for existing software systems PSM PSM Abstract Syntax Tree Metamodel (ASTM) Legacy a modelling language for fine grained reverse engineering Systems Platforms of yesterday Platforms of today (even tomorrow)  47 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 48. Agenda Motivation (Meta)Modeling MDA Putting MDE to work Conclusion 48 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 49. Putting MDE to work M2DAT-DB Overview Conceptual PIM Data Model Model-to-Model Transformations Tree-like Editor (EMF) UML2SQL2003 PSM PSM OR Model ORA2SQL2003 OR Model XML SQL20032ORA SQL2003 Model Diagrammer (GMF) CODE XML SQL SQL Schema Model-to-Text Transformations Model Validation (EVL Files) Modelling ORDB Schemas MOFScript 49 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 50. Putting MDE to work: M2DAT-DB Modelling ORDB Schemas : ORDB4ORA Metamodel c2 Ecore ≈ Eclipse MOF c2 ORDB4ORA.ecore c2 Sample.ordb4ora 50 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 51. Putting MDE to work: M2DAT-DB Modelling ORDB Schemas: model editors c2 ECore EMF generates a tree- based editor with GMF generates a basic capabilities c2 complete diagrammer ORDB4ORA.ecore c2 c2 Sample.ordb4ora Sample.ordb4ora_diagram 51 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 52. Putting MDE to work M2DAT-DB Overview Conceptual Model-to-Model Transformations PIM Data Model Graph Grammars ↓ ATL Mapping Rules (ATL) ↓ Tree-like Editor Design Decisions (AMW) (EMF) Replicate Model Transformation (VIATRA, QVTo, mediniQVT) UML2SQL2003 PSM M2M XML Transformation PSM OR Model ORA2SQL2003 OR Model SQL20032ORA SQL2003 UML2 Model ↓↓↓ Diagrammer ORDB4ORA (GMF) CODE XML SQL SQL Schema Model-to-Text Transformations Model Validation (EVL Files) (MOFScript) 52 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 53. Putting MDE to work: M2DAT-DB Model to Model Transformation Vara, J. M., Vela, B., Bollati, V., & Marcos, E. (2009). Supporting Model-Driven Development of Object-Relational Database Schemas: a Case Study Paper presented at the ICMT2009 - International Conference on Model Transformation, Zurich, Switzerland. Springer-Verlag, Berlin, Heidelberg, 181-196. Natural • QVT Usability Language • ATL Adoption — Support — Interoperability Graph Grammars Formalization • Shorten the distance between M2M toolsmiths and practitioners ATL • Detect errors and inconsistencies at first stages of development Implementation Vara, J. M., Vela, B., Cavero, J. M., and Marcos, E. 2007. Model transformation for object-relational database development. In Proceedings of the 2007 ACM Symposium on Applied Computing (Seoul, Korea, March 11 - 15, 2007). SAC '07. ACM, New York, NY, 1012-1019. 53 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 54. Putting MDE to work: M2DAT-DB Model to Model Transformation Product Data PSM Data PIM Standard Data PSM (SQL:2003) (Oracle10g) Class Structured Type + Typed Table Object Type + Object Table Class Extension Typed Table Table of Object Type Multivalued Array/Multiset Varray/Nested Table Attributes Composed ROW/Structured Type (column) Object Type (column) Calculated Trigger/Method Trigger/Method One-To-One Ref/Ref Ref/Ref One-To-Many Ref/Multiset/Array Ref/Nested Table/Varray Association Many-To-Many Multiset/Multiset - Array/Array Nested Table/Nested Table - Varray/Varray Aggregation Multiset/Array Nested Table/Varray of References Nested Table/Varray Composition Multiset/Array of Objects Generalization Types/Typed Tables Types/Typed Tables 54 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 55. Putting MDE to work: M2DAT-DB M2M transformation: Classes and Properties 1 rule Class2UDT { LHS RHS 2 from - UML Class Diagram - - OR Model - 3 c : UML!Class 4 to 1 1‟ 5 udt : ORDB4ORA!StructuredType( ???:UML::Class match(1).name:OR::Typed Table 6 Name <- c.name + „ <<UDT>>', name:String=??? 7 typed <- tt, 8 method <- meth_seq, 1‟ match(1).name + “_Type”:OR::Structured Type 9 supertype <- if (not c.generalization-> first()->oclIsUndefined()) then ownedAttibute 10 c.generalization->first().general 11 else * 2 12 OclUndefined ???:UML::Property * 2‟ 13 endif, name:String=?? match(2).name:OR::Attribute 14 model <- thisModule.package datatype:Datatype=?? datatype = match(2).datatype 15 ), 16 meth_seq : distinct ORDB4ORA!Method foreach 17 (op in c.ownedOperation)(Name <- op.name), 18 tt : ORDB4ORA!TypedTable( 19 Name <- c.name + 's <<PERSISTENT>>') 20 } 21 22 rule Property2Attribute { 23 from 24 p:UML!Property (not p.isDerived and not p.isMultivalued() and 25 p.refImmediateComposite().oclIsTypeOf(UML!Class)) 26 to 27 a : ORDB4ORA!Attribute( rule Class2UDT {…} 28 Name <- p.name, rule Property2Attribute {…} 29 Type <- p.type, 30 structured <- p->refImmediateComposite()) 31 } Product Data PSM Data PIM (Oracle10g) Class Object Type + Object Table Property Attribute 55 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 56. Putting MDE to work: M2DAT-DB M2M transformation: Classes and Properties 1 rule Class2UDT { LHS RHS 2 from - UML Class Diagram - - OR Model - 3 c : UML!Class 4 to 1 1‟ 5 udt : ORDB4ORA!StructuredType( ???:UML::Class match(1).name:OR::Typed Table 6 Name <- c.name + „ <<UDT>>', name:String=??? 7 typed <- tt, 8 method <- meth_seq, 1‟ match(1).name + “_Type”:OR::Structured Type 9 supertype <- if (not c.generalization-> first()->oclIsUndefined()) then ownedAttibute 10 c.generalization->first().general 11 else * 2 12 OclUndefined ???:UML::Property * 2‟ 13 endif, name:String=?? match(2).name:OR::Attribute 14 model <- thisModule.package datatype:Datatype=?? datatype = match(2).datatype 15 ), 16 meth_seq : distinct ORDB4ORA!Method foreach 17 (op in c.ownedOperation)(Name <- op.name), 18 tt : ORDB4ORA!TypedTable( Each class is mapped to an UDT 19 20 } Name <- c.name + 's <<PERSISTENT>>') plus a Typed Table 21 22 rule Property2Attribute { 23 from 24 p:UML!Property (not p.isDerived and not p.isMultivalued() and 25 p.refImmediateComposite().oclIsTypeOf(UML!Class)) 26 to 27 a : ORDB4ORA!Attribute( rule Class2UDT {…} 28 Name <- p.name, rule Property2Attribute {…} 29 Type <- p.type, 30 structured <- p->refImmediateComposite()) 31 } 56 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 57. Putting MDE to work: M2DAT-DB M2M transformation: Classes and Properties 1 rule Class2UDT { LHS RHS 2 from - UML Class Diagram - - OR Model - 3 c : UML!Class 4 to 1 1‟ 5 udt : ORDB4ORA!StructuredType( ???:UML::Class match(1).name:OR::Typed Table 6 Name <- c.name + „ <<UDT>>', name:String=??? 7 typed <- tt, 8 method <- meth_seq, 1‟ match(1).name + “_Type”:OR::Structured Type 9 supertype <- if (not c.generalization-> first()->oclIsUndefined()) then ownedAttibute 10 c.generalization->first().general 11 else * 2 12 OclUndefined ???:UML::Property * 2‟ 13 endif, name:String=?? match(2).name:OR::Attribute 14 model <- thisModule.package datatype:Datatype=?? datatype = match(2).datatype 15 ), 16 meth_seq : distinct ORDB4ORA!Method foreach 17 (op in c.ownedOperation)(Name <- op.name), 18 tt : ORDB4ORA!TypedTable( Each property is mapped to an 19 20 } Name <- c.name + 's <<PERSISTENT>>') attribute in the UDT 21 22 rule Property2Attribute { 23 from 24 p:UML!Property (not p.isDerived and not p.isMultivalued() and 25 p.refImmediateComposite().oclIsTypeOf(UML!Class)) 26 to 27 a : ORDB4ORA!Attribute( rule Class2UDT {…} 28 Name <- p.name, rule Property2Attribute {…} 29 Type <- p.type, 30 structured <- p->refImmediateComposite()) 31 } 57 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 58. Putting MDE to work: M2DAT-DB Model to Text Transformation PIM Conceptual Data Model MIDAS/DB MIDAS proposal for the content aspect M2T Transformation PSM ORDB4ORA Model PSM OR XML ↓↓↓ Model Model SQL Script SQL XML CODE Schema 58 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 59. Putting MDE to work M2DAT-DB Overview Conceptual Model-to-Model Transformations PIM Data Model Graph Grammars ↓ ATL Mapping Rules (ATL) ↓ Tree-like Editor Design Decisions (AMW) (EMF) Replicate Model Transformation (VIATRA, QVTo, mediniQVT) UML2SQL2003 PSM M2T Transformation PSM OR Model ORA2SQL2003 OR Model XML SQL20032ORA SQL2003 ORDB4ORA Model Model ↓↓↓ Diagrammer SQL Script (GMF) CODE XML SQL SQL Schema Model-to-Text Transformations Model Validation (EVL Files) (MOFScript) 59 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 60. Putting MDE to work: M2DAT-DB Model to Text Transformation 11 texttransformation codigo (in eco:"http:///ORDB4ORA.ecore") { 12 13 eco.Model::main(){ 14 var nombre:String 15 16 if (self.Name.size()=0) 17 nombre="codigo.sql" 18 else 19 nombre=self.Name + ".sql" 20 file (nombre) …………………………………….. 22 //Code Generation for Structured Types 23 self.datatype->forEach(s:eco.StructuredType) 24 { 25 s.generateStructured() 25 println("") 27 } …………………………………….. 29 //Code Generation for Reference Types 30 self.datatype->forEach(r:eco.ReferenceType){ 31 println("CREATE OR REPLACE TYPE " + 32 r.Name.replace("<<ref>>", "") + 33 " AS OBJECT (ref REF " + 34 r.Type.Name.replace("<<udt>>", "") + 35 ");n") 35 } 191 self.operation->forEach(f:eco.Function) 192 { 193 if(f.package = null) 194 { 195 print("CREATE OR REPLACE ") 196 f.generateFunction() 197 println("") 198 } 199 } MOFScript 200 } 60 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 61. Putting MDE to work: M2DAT-DB Model to Text Transformation 11 texttransformation codigo (in eco:"http:///ORDB4ORA.ecore") { 12 13 eco.Model::main(){ 14 var nombre:String 15 16 if (self.Name.size()=0) 17 nombre="codigo.sql" 18 else 19 nombre=self.Name + ".sql" 20 file (nombre) …………………………………….. 22 //Code Generation for Structured Types 23 self.datatype->forEach(s:eco.StructuredType) 24 25 { s.generateStructured() For simple rules, we code the 25 println("") rule inside the main body 27 } …………………………………….. 29 //Code Generation for Reference Types 30 self.datatype->forEach(r:eco.ReferenceType){ 31 println("CREATE OR REPLACE TYPE " + 32 r.Name.replace("<<ref>>", "") + 33 " AS OBJECT (ref REF " + 34 r.Type.Name.replace("<<udt>>", "") + 35 ");n") 35 } 191 self.operation->forEach(f:eco.Function) 192 { 193 if(f.package = null) 194 { 195 print("CREATE OR REPLACE ") 196 f.generateFunction() 197 println("") 198 } 199 } MOFScript 200 } 61 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 62. Putting MDE to work: M2DAT-DB Model to Text Transformation 11 texttransformation codigo (in eco:"http:///ORDB4ORA.ecore") { 12 13 eco.Model::main(){ 14 var nombre:String 15 16 if (self.Name.size()=0) 17 nombre="codigo.sql" 18 else 19 nombre=self.Name + ".sql" 20 file (nombre) …………………………………….. 22 //Code Generation for Structured Types 23 self.datatype->forEach(s:eco.StructuredType) 24 { 25 s.generateStructured() 25 println("") 27 } …………………………………….. 29 //Code Generation for Reference Types 30 self.datatype->forEach(r:eco.ReferenceType){ 31 println("CREATE OR REPLACE TYPE " + 32 r.Name.replace("<<ref>>", "") + 33 " AS OBJECT (ref REF " + 34 r.Type.Name.replace("<<udt>>", "") + 35 ");n") 35 } 191 self.operation->forEach(f:eco.Function) 192 { 193 if(f.package = null) The complex ones are coded by 194 { 195 196 print("CREATE OR REPLACE ") f.generateFunction() means of auxiliary functions. 197 println("") 198 } 199 } MOFScript 200 } 62 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 63. Putting MDE to work: M2DAT-DB Model to Text Transformation 11 texttransformation codigo (in eco:"http:///ORDB4ORA.ecore") { 12 13 eco.Model::main(){ 14 var nombre:String 15 16 if (self.Name.size()=0) 17 nombre="codigo.sql" 18 else 19 nombre=self.Name + ".sql" 20 file (nombre) …………………………………….. 22 //Code Generation for Structured Types 23 self.datatype->forEach(s:eco.StructuredType) 24 { 25 s.generateStructured() 25 println("") 27 } …………………………………….. 29 //Code Generation for Reference Types 30 self.datatype->forEach(r:eco.ReferenceType){ 31 println("CREATE OR REPLACE TYPE " + 32 r.Name.replace("<<ref>>", "") + 33 " AS OBJECT (ref REF " + 34 r.Type.Name.replace("<<udt>>", "") + 35 ");n") 35 } 191 self.operation->forEach(f:eco.Function) 192 { 193 if(f.package = null) 194 { 195 print("CREATE OR REPLACE ") Those functions are invoked 196 f.generateFunction() 197 println("") from the main body 198 } 199 } MOFScript 200 } 63 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 64. Putting MDE to work: M2DAT-DB Model to Text Transformation The generateStructured rule creates the Manager and Project UDTs eco.StructuredType::generateStructured() {…} MOFScript self.attribute->forEach(a:eco.Attribute) {…} Code Generation self.datatype->forEach(r:eco.ReferenceType) self.typed->forEach(t:eco.TypedTable){…} MOFScript Their attributes are created in the CREATE OR REPLACE TYPE Manager AS OBJECT ( CREATE OR REPLACE TYPE Project AS OBJECT ( main body Cod_Manager Name VARCHAR2(25), VARCHAR2(25), Cod_Project Name VARCHAR2(25), VARCHAR2(25), Address Address_Type, plans NT_Plans, manage REF_Project managed_by REF_Manager) Telephone VARCHAR2(25)) / / CREATE OR REPLACE TYPE Ref_Project AS OBJECT ( CREATE OR REPLACE TYPE Ref_Manager AS OBJECT ( ref REF Project) ref REF Manager) / / CREATE TABLE Projects OF Project CREATE TABLE Managers OF Manager; NESTED TABLE plans STORE AS Plans_List; 64 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 65. Putting MDE to work: M2DAT-DB Model to Text Transformation As well, the REF types are created in the main body eco.StructuredType::generateStructured() {…} MOFScript self.attribute->forEach(a:eco.Attribute) {…} Code Generation self.datatype->forEach(r:eco.ReferenceType) self.typed->forEach(t:eco.TypedTable){…} MOFScript CREATE OR REPLACE TYPE Manager AS OBJECT ( CREATE OR REPLACE TYPE Project AS OBJECT ( Cod_Manager VARCHAR2(25), Cod_Project VARCHAR2(25), Name VARCHAR2(25), Name VARCHAR2(25), Address Address_Type, plans NT_Plans, manage REF_Project managed_by REF_Manager) Telephone VARCHAR2(25)) / / CREATE OR REPLACE TYPE Ref_Project AS OBJECT ( CREATE OR REPLACE TYPE Ref_Manager AS OBJECT ( ref REF Project) ref REF Manager) / / CREATE TABLE Projects OF Project CREATE TABLE Managers OF Manager; NESTED TABLE plans STORE AS Plans_List; 65 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 66. Putting MDE to work: M2DAT-DB Model to Text Transformation The Tabled Types are also created in the main body eco.StructuredType::generateStructured() {…} MOFScript self.attribute->forEach(a:eco.Attribute) {…} Code Generation self.datatype->forEach(r:eco.ReferenceType) self.typed->forEach(t:eco.TypedTable){…} MOFScript CREATE OR REPLACE TYPE Manager AS OBJECT ( CREATE OR REPLACE TYPE Project AS OBJECT ( Cod_Manager VARCHAR2(25), Cod_Project VARCHAR2(25), Name VARCHAR2(25), Name VARCHAR2(25), Address Address_Type, plans NT_Plans, manage REF_Project managed_by REF_Manager) Telephone VARCHAR2(25)) / / CREATE OR REPLACE TYPE Ref_Project AS OBJECT ( CREATE OR REPLACE TYPE Ref_Manager AS OBJECT ( ref REF Project) ref REF Manager) / / CREATE TABLE Projects OF Project CREATE TABLE Managers OF Manager; NESTED TABLE plans STORE AS Plans_List; 66 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 67. Putting MDE to work: M2DAT-DB M2DAT-DB Web site • More info at M2DAT-DB Web site – Videos – Case Studies – User Manual – Download http://m2datdb.wordpress.com 67 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 68. Agenda Motivation (Meta)Modeling MDA Putting MDE to work Conclusion 68 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 69. Conclusion Adopting MDE … Based on sound and time-proven Benefits of adopting MDE principles  Ease of platform migration  Higher levels of abstraction  Reqs traceability until working-code  Higher levels of automation  Automation + Reutilization =  Higher levels of standardization ↑ Productivity But …. the use of MDE is still an exception Cultural and economic hurdles hampering MDE adoption — Tools: very few, poor usability, lack of interoperability — Cultural change: Software developers  Sofware Modellers — Incorrectly associated to heavy-weight methodologies — Initial adoption costs … and develop tools for No silver-bullet it (e.g., Web-based Mappings play a cornerstone role systems)  “No manual coding” is not 100% achievable in  Models become your CORPORATE ASSETS general  Use mappings between the models for …  Need to identify the domains in which MDE can refinements, abstractions, migrations … be effectively used 69 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 70. Conclusion Some reflections • ¿De verdad crees que funciona esto del MDE? – ¿Seremos capaces de generar código a partir de modelos, incluso cuando todavía no estamos de acuerdo ni en cómo representar el comportamiento? – ¿Sinceramente, tu crees en eso de pintar dos cajas y tres líneas y obtener todo el código de tu aplicación? MDE compensa a medio plazo Desarrollo Industrial de Software 70 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 71. Credits & Acknowledgements A number of slides in this presentation have been adapted from the following previous works • [Bézivin 2006] → Introduction to Model Engineering, Jean Bézivin. OpenCourseWare. • [Paige 2006] → The Meta-Object Facility (MOF), Richard Paige. OpenCourseWare. • [Barbero, Didonet Del Fabro 2007] → Practice of Model Transformation and Model Weaving in the Eclipse Modeling Project with ATL and AMW, Mikael Barbero & Marcos Didonet Del Fabro. Tutorial at TOOLS Europe 2007. • [Selic 2008] → Opportunities in the Domain of Model-Driven Development, Bran Selic. Guest Talk at JISBD’2008. • [Vallecillo 2008] → A Journey through the Secret Life of Models. A. Vallecillo. Daghstul Seminars: Perspectives Workshop: Model Engineering of Complex Systems. • [Bézivin 2009] → Advances in Model Driven Engineering: Achievements and Challenges, Jean Bézivin. Guest Talk at JISBD’2009. … thanks to all of them 71 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development @Santander ~ 21 July, 2011
  • 72. Gestión Avanzada de Datos @Santander – 21 July, 2011 Model-Driven Engineering: a first glance at a ¿new? way of conceiving software development Juan M. Vara juanmanuel.vara@urjc.es Kybele Research Group University Rey Juan Carlos (Madrid - Spain)