SlideShare a Scribd company logo
1 of 57
Download to read offline
Mastering differentiated
                                         MDSD requirements at
                                         Deutsche Börse AG

                                         Code Generation 2009


                                         Heiko Behrens (itemis)
                                         Karsten Thoms (itemis)




© itemis AG 2009 – All rights reserved
The project at
Deutsche Börse
! Projects delivers a “Global Trading System”
! First (internal) user is ISE in NY
! Scalable, Distributed System
! Goes live in 2011
Structure of this talk


! 8 times
  Motivation ! Applied Approach
! Inbetween: Demo of discussed ideas
! In the end: Some discoveries we made



                                         http://www.bildtankstelle.de
Application of
Code Generation
 in this project
Reference                      Configuration                                                 Messaging                                                                   Excel Model
 Data Model                        Model                                                       Model
                                                                                                                                                   Scripting
                                                                                                                                                   Generator
                                                                                                                                                                          System
               Reference                                                                                                                                                   Test
                                                                                           Messaging
                 Data                                                                                                                                                    Generator
                                                                                           Generator
               Generator
                                                                                                                                              Structures   Structures


                                                                                                                                              Messages     Messages          Tests
                   Validation          IML
JPA Entities                                                   OFi          Messages         Messages      Docu
                   Listeners        Datatypes                                                                                                      C++     Python           Python
                                     Model
                   Val.List.
   DAOs            UnitTest                                                 Structures       Structures
                                                                                                                           XML                                           <<uses>>
                     DTOs
                                     IML                Msg/Struct.
                                                                                                                           Model
 Listener                                                                   Factories          Editor
                                                         Adapters
UOW Exec.        Persistence                                                                              HTML,
  Bean            Descriptor                                          C++                      Java        Text            XML
Msg Client         WSFacade         Report      <<uses>>
Descriptor                                                                                 <<uses>>                   <<uses>>
            Java                    HTML
                                                                                                                     Transactional
                                                                Container Model                                         Model


                                                                                                                                                             .Net
  Hibernate                     JAXB                                   Data                                                                                Generator
                                                                      Access                                             DB
                                                                     Generator                                         Service
                                WSFacade
                                                                                                                      Generator
   DDL Scripts                    XSD

      SQL                         XML
                                                                      Global key                                                                            Messages
                                                     Filters                            DDL Scripts
                                                                      functions

                                                                       Ref Data                                          UnitTest    DDL Scripts
                                                   Containers                                              Queries                                          Structures
                                                                      Mngr Class                                        Templates     (MySQL)

                                                     Boost                                                 DAOs                                              Factories
                                                    Operator

                                                                C++                       SQL                        C++               SQL                     .Net
Artifact sizes
                               Generated
                               Transformation
                               Model
                               Tests (manual)
                               Sources (manual)
                               Reference Impl.


                 2.747 units




                                Actual numbers had
                                 to be replaced by
                                   fictive “units”
Guess what!
   Motivation:
 Code Generation
Why Code Generation?
     ! Positive experience with former projects
     ! Prime example: mapping between
       messages and structures sending with a
       compact binary wire protocols

      Component                           Component
 Component                                  Structure B
                                         B1
                     A1   A3        A2   B2
   Structure B
B1                                         SubStructure S
                     B1   S1   B2   S2
B2                                        S1
  SubStructure S                          S2
 S1
 S2
Why openArchitectureWare?
Former times:
! Home-grown solution based on graphical modeling
  and proprietary tools
! Many different post-processors such as XSLT and Perl
Evaluation results of oAW for GTS
! Supports textual modeling
! Has mature tool support
! Works with different model types and output formats
Different Input , Different Output ,
 Same Transformation Language




Text UML                      C++      Java
               Xpand
XML XMI                       XML      XMI
When in Rome
do as the Romans do
Motivation: Address existing experience
            and perception
Modeling in UML
! Years of experience for modeling entities
  graphically (ER-Diagram)
! Established Tool (MagicDraw)
! Proven Technology (Profiles, Tagged
  Values)
! Great for overview perspectives
UML Reference Model
Textual Modeling
! Years of experience ;)
! Established tool support (grep, editor,
  mail, svn)
! Highly customizable ! DSL
! Inexpensive metamodel evolvement
! Great for detailed modeling
Textual Model
!""#$%&!$'!($)#*"




                    Motivation:
            Reduce Complexity of Modeling
Reducing Model
      Complexity
! Following Convention-over-configuration
  paradigm for modeling
! Only model necessary information
! Complete model according to
  conventions by M2M transformation
Convention over Configuration

                     can be derived




                 required model
                   information
Convention: Navigable association ends without
                                       name get the name of the referred Entity. Use plural for to
                                                        many relationships.




uml::Model modify (uml::Model this) :
     ... ->
     // Search for unnamed association ends and give them a default name
     this.eAllContents.typeSelect(Property)
           .select(x|x.association!=null).nameUnnamedEnds() ->
     ...




/**
 * This function sets a default name for an association's end property if the property
 * has no name and it is navigable.
 */
Void nameUnnamedEnds(Property this) :
     if
           !isNamed() && isNavigable()
     then (
           ("setting default name for association end "+opposite.type.name+" -> "+type.name).info() ->
           setName(computeDefaultName())
     )
     -> this;
Convention over Configuration
Convention: All entities without <<Key>> attribute get a
                                        new property with name id of type Long, and Stereotype
                                                          <<Key>> is applied.




uml::Model modify (uml::Model this) :
     ... ->
     // Search for unnamed association ends and give them a default name
     this.eAllContents.typeSelect(Property)
           .select(x|x.association!=null).nameUnnamedEnds() ->
     ...




private create uml::Property createTechnicalId(RDMProfile::Entity entity):
     ("Creating technical id attribute for entity "+entity.name).debug() ->
     entity.ownedAttribute.addToFront(this) ->
     this.setName("id") ->
     this.setType(findDataType(„Long“) ->
     this.setLower(1) ->
     this.setUpper(1) ->
     this.setIsUnique(true) ->
     this.setVisibility(uml::VisibilityKind::^private) ->
     this.applyStereotype("RDMProfile::Key") ->
     this.setTaggedValue("RDMProfile::Key", "keyType", RDMProfile::KeyType::PK)->
     this.applyStereotype("RDMProfile::Field") ->
     this.setTaggedValue("RDMProfile::Field", "uniqueGroup", "444")->
     this;
Combination of model types

                                               Domain model
                                               UML2
                                               platform independent


                                               Configuration model
                                               textual DSL
                                               platform dependent
entity Market
{
    relatedTo MarketAbstract with EAGER loading and cascade with PERSIST
    relatedTo MarketGroup with LAZY loading and cascade with PERSIST
}
Combination of model types
                            entity Market
                            {
                                relatedTo MarketAbstract with EAGER loading and cascade with PERSIST
                                relatedTo MarketGroup with LAZY loading and cascade with PERSIST
                            }




public class Market implements RDSEntity, Serializable {
    ...
    @OneToMany(mappedBy = "market", cascade = CascadeType.PERSIST)
    @Basic(fetch = FetchType.EAGER)
    private List<MarketAbstract> marketAbstracts =
        new ArrayList<MarketAbstract>();
    @ManyToMany(cascade = CascadeType.PERSIST, targetEntity = MarketGroup.class,
mappedBy = "markets")
    @Basic(fetch = FetchType.LAZY)
    private List<MarketGroup> marketGroups = new ArrayList<MarketGroup>();
Avoidable Accidents


               Motivation:
            Detect errors early
                      (c) Ernest von Rosen, www.amgmedia.com
l               e                t                :
                                 t ityRe = -1).siz emberEnd. t set)!"
                         e::En pper =
                   ofil |e.u                          " + m ion is no                                                (
            RD MPr         e                at  ion          at                                              > 1 &&
con text d.select(                 n y rel rOfAssoci                                              ))  .size )!="n
       er  En          y   to ma       (o wne                                            Ac tive( String(

             Detecting errors early
(memb NING "Man relation                    ll;                             t(e  |e.is tion.to           "   must
                                                                                                                    b
      WAR                           != nu                                ec              a
               of  the          on                              p e.sel |e.aggreg .info() + not appl
   s o wner        sso ciati                             nd.ty lect(e
                                                   berE d.se
                                                                                          e
                                                                                   e.nam tereotype
 a              fA                               m                               p
       o wnerO                        n  if me mberEn                 rE nd.ty ion (s
                            c iatio ) && me                 + membe e relat
                    :Asso e == 2
               uml: .siz                        ati  on "         of th ;
     ntext == -1)                            el              er
   co                          to m  any r es as own nce(this)                                 ll)             an en
                                                                                                                     t
           er              y               it i            ta                               nu             s
   e.upp NING "Man f the ent ion.isIns                                            o n ==          e rence
         WAR          ne  o            el at                           so  ciati ame+" ref
               ine o ::EntityR                                  & (as class.n
    a        ! Check constraints implemented for
             f
      nd de rofile
            DMP                             .isAc
                                                    t
                                                         in en
                                                              &
                                                      ive() tity "+
          R                           lass                                                                           =
                             y  if c          m e + "                                                        f ault!
                  Propert ty " + na                                );                               & & ^de fault
      con  text  ! Every assumption or modeling restriction
                    "Pro
            ERROR n!":
                          per
                                            isIns
                                                    ta nce (type
                                                                            ciati
                                                                                    on   ==  null
                                                                                             t nul
                                                                                                    l ) as
                                                                                                            de
                                  ntity
                                          .                              so               no
               ia tio          :E                                && as          r ing (
       assoc MProfile:                                   ive()         p ty st
             !RD ! Modeling error that lead to generator or
                                          as  s.isA
                                   if cl loc()+" h
                                                      ct
                                                           as  an em
                                                                                                 y
                                                                                                          st ance(
                                                                                                   .isIn ce it i
                                                                                                                    c
                         perty rty "+                                                      Entit y, sin
         cont      artifact errors (e.g. Whitespace in names)
               ext P
                      ro
                    ING "
                            Pr  ope                                          Pr
                                                                     & RDM typed a
                                                                                        ::
                                                                                ofile s Entit
              WARN                                          ve()
                                                                    &         o
                                                     s Acti           stere
            "";                              ass.i " must be :
          =
             ! Inter-model consistency checks
                         op  ert  y if
                                         cl
                                           pe
                                                      +
                                              .name y "+name );                                          In  stanc
                                                                                                                    e(
              nte xt Pr lass "+ty propert                     f(t  ype                         nti ty.is      are a
                                                                                                                     l
           co              C                               ce                               :E             s
                ER ROR " +" in its .isInstan                                      o file: umeration
             ! Risk of modeling errors decreased
                      .n ame           ti ty                           &  RDMPr nal En
            "+ class ofile::En                               iv e() & Functio
                 RD MPr                             . isAct pes or
                                        if  class Dataty                               ype)
                                                                                              ||
                                    y                                                t
                         Pr opert unctional                               st ance( pe);
             con  text          nl y F                         pe  .isIn ance(ty
                   ERR OR "O "+loc() : nalDataTy .isInst
                                                                n
                     te d for ::Functio numeratio
              Viola       rofil
                                  e
                                         ional
                                                 E
Constraints with Check language
context uml::Association
     if memberEnd.type.select(e|e.isActive()).size>1
     && (memberEnd.select(e|e.upper == -1).size == 2)
     && memberEnd.select(e|e.aggregation.toString()!="none").size == 2
    WARNING "Many to many relation " + memberEnd.type.name.info() +
        " must be of type EntityRelation and define one of the entities" +
      " as owner of the relation (stereotype not applied)!" :
    RDMProfile::EntityRelation.isInstance(this);


context Property if class.isActive() && (association == null)
    ERROR "Property " + name + " in entity "+class.name +
      " references an entity, but is not an association!":
    !RDMProfile::Entity.isInstance(type);


context Property
    if class.isActive() && association == null && ^default!=null
    WARNING "Property "+loc()
           +" has an empty string (not null) as default value"
     : ^default.trim()!="";
Integration
! Static Typing while developing
  checks and transformations

! IDE integration for workflows invocation

! Continuous Generation (server-side)
  CMake / Ant / Maven

! Automated execution after SVN checkout
Demo
! Graphical EMF model
! Enhanced with textual DSL (with Xtext)
! Validation
! Code Generation
! Changes textual DSL
Standing on the
                shoulders of giants
      Motivation:
Reusing generator aspects
Cartridge adaption
! Using OS cartridges as         Cartridge
                                 Workflow
                                               DTO
                                             Template
                                                             WebService
                                                              Template
                                                                              UnitTest
                                                                              Template

  closed package
                                                          Project Cartridge

                              <<call>>
! Required model structure
  created through M2M
                                 Adapter        Aspect           M2M
                                 Workflow       Template      Transformation


  transformation                                 Fornax Adapter Cartridge
                              <<call>>               <<redefines>>

! Required changes added         Cartridge   Annotation      EntityClass      Mapping

  non-invasive through
                                 Workflow      Template        Template        Template



  Xpand/Xtend AOP support                      Fornax Hibernate Cartridge

                              <<call>>                               <<redefines>>


! Redefined functionality         Cartridge
                                 Workflow
                                             Attribute
                                             Template
                                                                Class
                                                              Template
                                                                              Operation
                                                                              Template


  concentrated in a small
                                              Fornax JavaBasic Cartridge
  adapter cartridge project
UML2 model modification with Xtend
uml::Model modify (uml::Model this) :
     this.applyProfile(getPersistenceProfile()) ->
     // Create real enumerations for FunctionalEnumerations. This must be done first since
     // we map datatypes after that
     this.eAllContents.typeSelect(RDMProfile::FunctionalEnumeration).adaptEnumeration() ->
     entities().adaptEntity() ->
     adaptEmbeddedKeys() ->
     this;

RDMProfile::Entity adaptEntity (RDMProfile::Entity entity) :
     debug("Adapting entity: "+ entity.name) ->
     entity.applyStereotype("Persistence::Entity") ->
     entity.setTaggedValue("Persistence::Entity", "tableName", entity.name.asTableName())->
     entity.testAndAssignInheritanceStrategy()->
     entity.attribute.select(a|a.association==null).adaptAttribute() ->
     entity.attribute.select(a|a.association!=null).adaptRelation() ->
     entity;


//In case the entity extends another class, assigne the persistence stereotype for
//strategy on the uml::Generalization
//TPC="TABLE_PER_CLASS" | J="JOINED" | ST="SINGLE_TABLE";
Void testAndAssignInheritanceStrategy(RDMProfile::Entity this):
     if !general.isEmpty
     then assignInheritanceStrategy();

Void assignInheritanceStrategy(RDMProfile::Entity this):
     let gener = generalization.first():
     gener.applyStereotype("Persistence::"+getInheritanceStrategyFromDardl().mapToStrategy()) ->
     if(getInheritanceStrategyFromDardl() == "SINGLE_TABLE")
     then (
       gener.setTaggedValue("Persistence::TablePerClassHierarchy",
               "discriminator_value", getDiscriminatorValue())->
       gener.setTaggedValue("Persistence::TablePerClassHierarchy",
               "discriminator_superClass_column", gener.general.name+"_type")->
       gener.setTaggedValue("Persistence::TablePerClassHierarchy",
               "discriminator_superClass_type", "INTEGER")
     )
     ;
AOP with templates and functions
   «AROUND org::fornax::cartridges::uml2::javabasic::templates::Documentation::documentation
    FOR uml::Classifier»
        «targetDef.proceed()»
        «EXPAND JPAAnnotations»
   «ENDAROUND»

   «DEFINE JPAAnnotations FOR Persistence::Entity»
        @javax.persistence.Entity
        @javax.persistence.Table(name="«asTableName()»")

        «EXPAND InheritanceAnnotations»

        @javax.persistence.NamedQueries({
            @javax.persistence.NamedQuery(name="find«name»s", query="SELECT e from «name» e")
        })

        «IF !isAbstract»
        @javax.persistence.EntityListeners
           («getQualifiedPackageName("ListenerOnce")».«name»ValidationListener.class)
        «ENDIF»
        «EXPAND UniqueConstraints»
   «ENDDEFINE»




around org::fornax::cartridges::uml2::javabasic::extensions::DataType::NormalizedDefaultValue(
   uml::Property property): internal_getNormalizedDefaultValue(property);

private String internal_getNormalizedDefaultValue (uml::Property property) :
     JAVA gts.ise.refdata.oaw.fornax.util.Extensions.getNormalizedDefaultValue(org.eclipse.uml2.uml.Property);
Arange your ideas

     Motivation:
Managing Manual Code
Sucessfully applied MDSD best practices

                   ! Separate generated from manual code
                   ! Avoid check-in generated code

      src                    BaseClass                             BaseClass
manually written



   src-gen            AbstractA     AbstractB                AbstractB                     AbstractD
always generated



                      ConcreteA                  ConcreteA
  src-once           Some           ConcreteB   Some         ConcreteB         ConcreteC   ConcreteD
                     Manual                     Manual
generated once
                     Code                       Code
Adjusted Folder Layout
Design your tools



               Motivation:
            Managing Generator
               Complexity
Reference Implementation

 ! Manually implemented
 ! Far more than a prototype!
 ! Compilable, deployable, executable, testable
 ! Covers every architectural concept
 ! Code seperated in to-be-generated and
   manual code
Reference Model

! Contains every supported modeling concept
! Not necessary excerpt from the real domain,
  but helps for understanding
! Try to minimize the model size
Testing the reference
! Reference Implementation is tested
  intensively and automatic
! Unit tests and integration tests with high
  coverage
! Tests against generated artifacts
! Real application does not need to be
  tested in the same extend
generated from
reference model




   manually
 implemented
   reference
Model metrics   Associations
                Attributes
                Entities
Motivation: Optimizing
  Generator Speed
   and Readability
Refactorings / Profiling

! Reference Implementation/Unit-Tests
  ensure valid output
! Static Typing of Xpand supports
  development
HTML report
HTML report
standard format (gprof)
standard format (gprof)
standard format (gprof)
Most significant problems
! Repeated calls of functions
! Suboptimal algorithms/data structures
! Branches with best-case scenarios


! Profiling reduced generation time
  from 28 min downto 3 min
Discoveries
Value of Cartridges


! Project benefited from cartridges
  developed by OS community
! But: Largest part of the code generators
  are totally project dependent
Early adopters
! Using the bleeding edge of Eclipse
  Modeling was challenging
! But: Continuous improvement of used
  technologies thanks to direct feedback
  with OS community
! And: Significant performance and
  stability gains since early adoption
Learning curve
! Establishing MDSD and tools was hard
  for unexperienced developers at the
  beginning
! But: Coaching helped to fill the gap fast
! And: Now developers educate others to
  use MDSD tooling
Reference Implementation

! Reference Models and Reference
  Implementation are invaluable
  ! Reducing the complexity
  ! Enable refactoring
! But: Effort to create and maintain a real
  Reference Implementation quite high
Personal blogs
http://www.1160pm.net
http://kthoms.wordpress.com   http://www.itemis.com

More Related Content

Similar to Mastering Differentiated MDSD Requirements at Deutsche Boerse AG

Scalable Services For Digital Preservation Ross King
Scalable Services For Digital Preservation Ross KingScalable Services For Digital Preservation Ross King
Scalable Services For Digital Preservation Ross KingDigitalPreservationEurope
 
End-to-end Model-driven Development of Applications with Eclipse using the ...
End-to-end Model-driven Development of Applications with Eclipse using  the ...End-to-end Model-driven Development of Applications with Eclipse using  the ...
End-to-end Model-driven Development of Applications with Eclipse using the ...emanuelemolteni
 
Friedenthal.sandford
Friedenthal.sandfordFriedenthal.sandford
Friedenthal.sandfordNASAPMC
 
Axel uhl sap@md-day2011
Axel uhl sap@md-day2011Axel uhl sap@md-day2011
Axel uhl sap@md-day2011MDDAY11
 
Wallchart - Data Warehouse Documentation Roadmap
Wallchart - Data Warehouse Documentation RoadmapWallchart - Data Warehouse Documentation Roadmap
Wallchart - Data Warehouse Documentation RoadmapDavid Walker
 
XML Metadata Interchange (XMI)
XML Metadata Interchange (XMI)XML Metadata Interchange (XMI)
XML Metadata Interchange (XMI)elliando dias
 
M3 Modernization Case Study
M3 Modernization Case StudyM3 Modernization Case Study
M3 Modernization Case StudyADC Austin Tech
 
Entity Framework - Entity Data Model (edm)
Entity Framework - Entity Data Model (edm)Entity Framework - Entity Data Model (edm)
Entity Framework - Entity Data Model (edm)Eyal Vardi
 
6.Live Framework 和Mesh Services
6.Live Framework 和Mesh Services6.Live Framework 和Mesh Services
6.Live Framework 和Mesh ServicesGaryYoung
 
Entity Framework - Queries
Entity Framework -  QueriesEntity Framework -  Queries
Entity Framework - QueriesEyal Vardi
 
Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving...
Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving...Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving...
Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving...mfrancis
 
Java Framework for Database-Centric Web Engineering
Java Framework for Database-Centric Web EngineeringJava Framework for Database-Centric Web Engineering
Java Framework for Database-Centric Web EngineeringBeat Signer
 
Model Driven Architecture (MDA): Motivations, Status & Future
Model Driven Architecture (MDA): Motivations, Status & FutureModel Driven Architecture (MDA): Motivations, Status & Future
Model Driven Architecture (MDA): Motivations, Status & Futureelliando dias
 
SysML to Discrete-event Simulation to Analyze Electronic Assembly Systems
SysML to Discrete-event Simulation to Analyze Electronic Assembly SystemsSysML to Discrete-event Simulation to Analyze Electronic Assembly Systems
SysML to Discrete-event Simulation to Analyze Electronic Assembly SystemsDaniele Gianni
 
Windows Azure Interoperability
Windows Azure InteroperabilityWindows Azure Interoperability
Windows Azure InteroperabilityMihai Dan Nadas
 
Adopting Agile Tools & Methods In A Legacy Context
Adopting Agile Tools & Methods In A Legacy ContextAdopting Agile Tools & Methods In A Legacy Context
Adopting Agile Tools & Methods In A Legacy ContextXavier Warzee
 
20090410 J Spring Pragmatic Model Driven Development In Java Using Smart
20090410   J Spring Pragmatic Model Driven Development In Java Using Smart20090410   J Spring Pragmatic Model Driven Development In Java Using Smart
20090410 J Spring Pragmatic Model Driven Development In Java Using SmartSander Hoogendoorn
 
SnapLogic corporate presentation
SnapLogic corporate presentationSnapLogic corporate presentation
SnapLogic corporate presentationpbridges
 
제1회 Korea Community Day 발표자료 Bigdata
제1회 Korea Community Day 발표자료 Bigdata 제1회 Korea Community Day 발표자료 Bigdata
제1회 Korea Community Day 발표자료 Bigdata Gruter
 
SD Forum 1999 XML Lessons Learned
SD Forum 1999 XML Lessons LearnedSD Forum 1999 XML Lessons Learned
SD Forum 1999 XML Lessons LearnedTed Leung
 

Similar to Mastering Differentiated MDSD Requirements at Deutsche Boerse AG (20)

Scalable Services For Digital Preservation Ross King
Scalable Services For Digital Preservation Ross KingScalable Services For Digital Preservation Ross King
Scalable Services For Digital Preservation Ross King
 
End-to-end Model-driven Development of Applications with Eclipse using the ...
End-to-end Model-driven Development of Applications with Eclipse using  the ...End-to-end Model-driven Development of Applications with Eclipse using  the ...
End-to-end Model-driven Development of Applications with Eclipse using the ...
 
Friedenthal.sandford
Friedenthal.sandfordFriedenthal.sandford
Friedenthal.sandford
 
Axel uhl sap@md-day2011
Axel uhl sap@md-day2011Axel uhl sap@md-day2011
Axel uhl sap@md-day2011
 
Wallchart - Data Warehouse Documentation Roadmap
Wallchart - Data Warehouse Documentation RoadmapWallchart - Data Warehouse Documentation Roadmap
Wallchart - Data Warehouse Documentation Roadmap
 
XML Metadata Interchange (XMI)
XML Metadata Interchange (XMI)XML Metadata Interchange (XMI)
XML Metadata Interchange (XMI)
 
M3 Modernization Case Study
M3 Modernization Case StudyM3 Modernization Case Study
M3 Modernization Case Study
 
Entity Framework - Entity Data Model (edm)
Entity Framework - Entity Data Model (edm)Entity Framework - Entity Data Model (edm)
Entity Framework - Entity Data Model (edm)
 
6.Live Framework 和Mesh Services
6.Live Framework 和Mesh Services6.Live Framework 和Mesh Services
6.Live Framework 和Mesh Services
 
Entity Framework - Queries
Entity Framework -  QueriesEntity Framework -  Queries
Entity Framework - Queries
 
Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving...
Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving...Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving...
Balconies, Patios, Terraces, and Bridges. Architectural approaches for moving...
 
Java Framework for Database-Centric Web Engineering
Java Framework for Database-Centric Web EngineeringJava Framework for Database-Centric Web Engineering
Java Framework for Database-Centric Web Engineering
 
Model Driven Architecture (MDA): Motivations, Status & Future
Model Driven Architecture (MDA): Motivations, Status & FutureModel Driven Architecture (MDA): Motivations, Status & Future
Model Driven Architecture (MDA): Motivations, Status & Future
 
SysML to Discrete-event Simulation to Analyze Electronic Assembly Systems
SysML to Discrete-event Simulation to Analyze Electronic Assembly SystemsSysML to Discrete-event Simulation to Analyze Electronic Assembly Systems
SysML to Discrete-event Simulation to Analyze Electronic Assembly Systems
 
Windows Azure Interoperability
Windows Azure InteroperabilityWindows Azure Interoperability
Windows Azure Interoperability
 
Adopting Agile Tools & Methods In A Legacy Context
Adopting Agile Tools & Methods In A Legacy ContextAdopting Agile Tools & Methods In A Legacy Context
Adopting Agile Tools & Methods In A Legacy Context
 
20090410 J Spring Pragmatic Model Driven Development In Java Using Smart
20090410   J Spring Pragmatic Model Driven Development In Java Using Smart20090410   J Spring Pragmatic Model Driven Development In Java Using Smart
20090410 J Spring Pragmatic Model Driven Development In Java Using Smart
 
SnapLogic corporate presentation
SnapLogic corporate presentationSnapLogic corporate presentation
SnapLogic corporate presentation
 
제1회 Korea Community Day 발표자료 Bigdata
제1회 Korea Community Day 발표자료 Bigdata 제1회 Korea Community Day 발표자료 Bigdata
제1회 Korea Community Day 발표자료 Bigdata
 
SD Forum 1999 XML Lessons Learned
SD Forum 1999 XML Lessons LearnedSD Forum 1999 XML Lessons Learned
SD Forum 1999 XML Lessons Learned
 

More from Heiko Behrens

beyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Webbeyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than WebHeiko Behrens
 
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with EclipseEclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with EclipseHeiko Behrens
 
MDSD for iPhone and Android
MDSD for iPhone and AndroidMDSD for iPhone and Android
MDSD for iPhone and AndroidHeiko Behrens
 
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010Heiko Behrens
 
MDSD on iPhone - EclipseCon 2010
MDSD on iPhone - EclipseCon 2010MDSD on iPhone - EclipseCon 2010
MDSD on iPhone - EclipseCon 2010Heiko Behrens
 
iPhonical and model-driven software development for the iPhone
iPhonical and model-driven software development for the iPhoneiPhonical and model-driven software development for the iPhone
iPhonical and model-driven software development for the iPhoneHeiko Behrens
 
Building DSLs with Xtext - Eclipse Modeling Day 2009
Building DSLs with Xtext - Eclipse Modeling Day 2009Building DSLs with Xtext - Eclipse Modeling Day 2009
Building DSLs with Xtext - Eclipse Modeling Day 2009Heiko Behrens
 
Xtext at Eclipse DemoCamp London in June 2009
Xtext at Eclipse DemoCamp London in June 2009Xtext at Eclipse DemoCamp London in June 2009
Xtext at Eclipse DemoCamp London in June 2009Heiko Behrens
 
Xtext - und was man damit anstellen kann
Xtext - und was man damit anstellen kannXtext - und was man damit anstellen kann
Xtext - und was man damit anstellen kannHeiko Behrens
 

More from Heiko Behrens (10)

beyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Webbeyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
 
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with EclipseEclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
 
MDSD for iPhone and Android
MDSD for iPhone and AndroidMDSD for iPhone and Android
MDSD for iPhone and Android
 
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
 
MDSD on iPhone - EclipseCon 2010
MDSD on iPhone - EclipseCon 2010MDSD on iPhone - EclipseCon 2010
MDSD on iPhone - EclipseCon 2010
 
iPhonical and model-driven software development for the iPhone
iPhonical and model-driven software development for the iPhoneiPhonical and model-driven software development for the iPhone
iPhonical and model-driven software development for the iPhone
 
Building DSLs with Xtext - Eclipse Modeling Day 2009
Building DSLs with Xtext - Eclipse Modeling Day 2009Building DSLs with Xtext - Eclipse Modeling Day 2009
Building DSLs with Xtext - Eclipse Modeling Day 2009
 
Xtext Webinar
Xtext WebinarXtext Webinar
Xtext Webinar
 
Xtext at Eclipse DemoCamp London in June 2009
Xtext at Eclipse DemoCamp London in June 2009Xtext at Eclipse DemoCamp London in June 2009
Xtext at Eclipse DemoCamp London in June 2009
 
Xtext - und was man damit anstellen kann
Xtext - und was man damit anstellen kannXtext - und was man damit anstellen kann
Xtext - und was man damit anstellen kann
 

Recently uploaded

costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 

Recently uploaded (20)

costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 

Mastering Differentiated MDSD Requirements at Deutsche Boerse AG

  • 1. Mastering differentiated MDSD requirements at Deutsche Börse AG Code Generation 2009 Heiko Behrens (itemis) Karsten Thoms (itemis) © itemis AG 2009 – All rights reserved
  • 2.
  • 3. The project at Deutsche Börse ! Projects delivers a “Global Trading System” ! First (internal) user is ISE in NY ! Scalable, Distributed System ! Goes live in 2011
  • 4. Structure of this talk ! 8 times Motivation ! Applied Approach ! Inbetween: Demo of discussed ideas ! In the end: Some discoveries we made http://www.bildtankstelle.de
  • 6. Reference Configuration Messaging Excel Model Data Model Model Model Scripting Generator System Reference Test Messaging Data Generator Generator Generator Structures Structures Messages Messages Tests Validation IML JPA Entities OFi Messages Messages Docu Listeners Datatypes C++ Python Python Model Val.List. DAOs UnitTest Structures Structures XML <<uses>> DTOs IML Msg/Struct. Model Listener Factories Editor Adapters UOW Exec. Persistence HTML, Bean Descriptor C++ Java Text XML Msg Client WSFacade Report <<uses>> Descriptor <<uses>> <<uses>> Java HTML Transactional Container Model Model .Net Hibernate JAXB Data Generator Access DB Generator Service WSFacade Generator DDL Scripts XSD SQL XML Global key Messages Filters DDL Scripts functions Ref Data UnitTest DDL Scripts Containers Queries Structures Mngr Class Templates (MySQL) Boost DAOs Factories Operator C++ SQL C++ SQL .Net
  • 7. Artifact sizes Generated Transformation Model Tests (manual) Sources (manual) Reference Impl. 2.747 units Actual numbers had to be replaced by fictive “units”
  • 8. Guess what! Motivation: Code Generation
  • 9. Why Code Generation? ! Positive experience with former projects ! Prime example: mapping between messages and structures sending with a compact binary wire protocols Component Component Component Structure B B1 A1 A3 A2 B2 Structure B B1 SubStructure S B1 S1 B2 S2 B2 S1 SubStructure S S2 S1 S2
  • 10. Why openArchitectureWare? Former times: ! Home-grown solution based on graphical modeling and proprietary tools ! Many different post-processors such as XSLT and Perl Evaluation results of oAW for GTS ! Supports textual modeling ! Has mature tool support ! Works with different model types and output formats
  • 11. Different Input , Different Output , Same Transformation Language Text UML C++ Java Xpand XML XMI XML XMI
  • 12. When in Rome do as the Romans do Motivation: Address existing experience and perception
  • 13. Modeling in UML ! Years of experience for modeling entities graphically (ER-Diagram) ! Established Tool (MagicDraw) ! Proven Technology (Profiles, Tagged Values) ! Great for overview perspectives
  • 15. Textual Modeling ! Years of experience ;) ! Established tool support (grep, editor, mail, svn) ! Highly customizable ! DSL ! Inexpensive metamodel evolvement ! Great for detailed modeling
  • 17. !""#$%&!$'!($)#*" Motivation: Reduce Complexity of Modeling
  • 18. Reducing Model Complexity ! Following Convention-over-configuration paradigm for modeling ! Only model necessary information ! Complete model according to conventions by M2M transformation
  • 19. Convention over Configuration can be derived required model information
  • 20. Convention: Navigable association ends without name get the name of the referred Entity. Use plural for to many relationships. uml::Model modify (uml::Model this) : ... -> // Search for unnamed association ends and give them a default name this.eAllContents.typeSelect(Property) .select(x|x.association!=null).nameUnnamedEnds() -> ... /** * This function sets a default name for an association's end property if the property * has no name and it is navigable. */ Void nameUnnamedEnds(Property this) : if !isNamed() && isNavigable() then ( ("setting default name for association end "+opposite.type.name+" -> "+type.name).info() -> setName(computeDefaultName()) ) -> this;
  • 22. Convention: All entities without <<Key>> attribute get a new property with name id of type Long, and Stereotype <<Key>> is applied. uml::Model modify (uml::Model this) : ... -> // Search for unnamed association ends and give them a default name this.eAllContents.typeSelect(Property) .select(x|x.association!=null).nameUnnamedEnds() -> ... private create uml::Property createTechnicalId(RDMProfile::Entity entity): ("Creating technical id attribute for entity "+entity.name).debug() -> entity.ownedAttribute.addToFront(this) -> this.setName("id") -> this.setType(findDataType(„Long“) -> this.setLower(1) -> this.setUpper(1) -> this.setIsUnique(true) -> this.setVisibility(uml::VisibilityKind::^private) -> this.applyStereotype("RDMProfile::Key") -> this.setTaggedValue("RDMProfile::Key", "keyType", RDMProfile::KeyType::PK)-> this.applyStereotype("RDMProfile::Field") -> this.setTaggedValue("RDMProfile::Field", "uniqueGroup", "444")-> this;
  • 23. Combination of model types Domain model UML2 platform independent Configuration model textual DSL platform dependent entity Market { relatedTo MarketAbstract with EAGER loading and cascade with PERSIST relatedTo MarketGroup with LAZY loading and cascade with PERSIST }
  • 24. Combination of model types entity Market { relatedTo MarketAbstract with EAGER loading and cascade with PERSIST relatedTo MarketGroup with LAZY loading and cascade with PERSIST } public class Market implements RDSEntity, Serializable { ... @OneToMany(mappedBy = "market", cascade = CascadeType.PERSIST) @Basic(fetch = FetchType.EAGER) private List<MarketAbstract> marketAbstracts = new ArrayList<MarketAbstract>(); @ManyToMany(cascade = CascadeType.PERSIST, targetEntity = MarketGroup.class, mappedBy = "markets") @Basic(fetch = FetchType.LAZY) private List<MarketGroup> marketGroups = new ArrayList<MarketGroup>();
  • 25. Avoidable Accidents Motivation: Detect errors early (c) Ernest von Rosen, www.amgmedia.com
  • 26. l e t : t ityRe = -1).siz emberEnd. t set)!" e::En pper = ofil |e.u " + m ion is no ( RD MPr e at ion at > 1 && con text d.select( n y rel rOfAssoci )) .size )!="n er En y to ma (o wne Ac tive( String( Detecting errors early (memb NING "Man relation ll; t(e |e.is tion.to " must b WAR != nu ec a of the on p e.sel |e.aggreg .info() + not appl s o wner sso ciati nd.ty lect(e berE d.se e e.nam tereotype a fA m p o wnerO n if me mberEn rE nd.ty ion (s c iatio ) && me + membe e relat :Asso e == 2 uml: .siz ati on " of th ; ntext == -1) el er co to m any r es as own nce(this) ll) an en t er y it i ta nu s e.upp NING "Man f the ent ion.isIns o n == e rence WAR ne o el at so ciati ame+" ref ine o ::EntityR & (as class.n a ! Check constraints implemented for f nd de rofile DMP .isAc t in en & ive() tity "+ R lass = y if c m e + " f ault! Propert ty " + na ); & & ^de fault con text ! Every assumption or modeling restriction "Pro ERROR n!": per isIns ta nce (type ciati on == null t nul l ) as de ntity . so no ia tio :E && as r ing ( assoc MProfile: ive() p ty st !RD ! Modeling error that lead to generator or as s.isA if cl loc()+" h ct as an em y st ance( .isIn ce it i c perty rty "+ Entit y, sin cont artifact errors (e.g. Whitespace in names) ext P ro ING " Pr ope Pr & RDM typed a :: ofile s Entit WARN ve() & o s Acti stere ""; ass.i " must be : = ! Inter-model consistency checks op ert y if cl pe + .name y "+name ); In stanc e( nte xt Pr lass "+ty propert f(t ype nti ty.is are a l co C ce :E s ER ROR " +" in its .isInstan o file: umeration ! Risk of modeling errors decreased .n ame ti ty & RDMPr nal En "+ class ofile::En iv e() & Functio RD MPr . isAct pes or if class Dataty ype) || y t Pr opert unctional st ance( pe); con text nl y F pe .isIn ance(ty ERR OR "O "+loc() : nalDataTy .isInst n te d for ::Functio numeratio Viola rofil e ional E
  • 27. Constraints with Check language context uml::Association if memberEnd.type.select(e|e.isActive()).size>1 && (memberEnd.select(e|e.upper == -1).size == 2) && memberEnd.select(e|e.aggregation.toString()!="none").size == 2 WARNING "Many to many relation " + memberEnd.type.name.info() + " must be of type EntityRelation and define one of the entities" + " as owner of the relation (stereotype not applied)!" : RDMProfile::EntityRelation.isInstance(this); context Property if class.isActive() && (association == null) ERROR "Property " + name + " in entity "+class.name + " references an entity, but is not an association!": !RDMProfile::Entity.isInstance(type); context Property if class.isActive() && association == null && ^default!=null WARNING "Property "+loc() +" has an empty string (not null) as default value" : ^default.trim()!="";
  • 28. Integration ! Static Typing while developing checks and transformations ! IDE integration for workflows invocation ! Continuous Generation (server-side) CMake / Ant / Maven ! Automated execution after SVN checkout
  • 29. Demo ! Graphical EMF model ! Enhanced with textual DSL (with Xtext) ! Validation ! Code Generation ! Changes textual DSL
  • 30. Standing on the shoulders of giants Motivation: Reusing generator aspects
  • 31. Cartridge adaption ! Using OS cartridges as Cartridge Workflow DTO Template WebService Template UnitTest Template closed package Project Cartridge <<call>> ! Required model structure created through M2M Adapter Aspect M2M Workflow Template Transformation transformation Fornax Adapter Cartridge <<call>> <<redefines>> ! Required changes added Cartridge Annotation EntityClass Mapping non-invasive through Workflow Template Template Template Xpand/Xtend AOP support Fornax Hibernate Cartridge <<call>> <<redefines>> ! Redefined functionality Cartridge Workflow Attribute Template Class Template Operation Template concentrated in a small Fornax JavaBasic Cartridge adapter cartridge project
  • 32. UML2 model modification with Xtend uml::Model modify (uml::Model this) : this.applyProfile(getPersistenceProfile()) -> // Create real enumerations for FunctionalEnumerations. This must be done first since // we map datatypes after that this.eAllContents.typeSelect(RDMProfile::FunctionalEnumeration).adaptEnumeration() -> entities().adaptEntity() -> adaptEmbeddedKeys() -> this; RDMProfile::Entity adaptEntity (RDMProfile::Entity entity) : debug("Adapting entity: "+ entity.name) -> entity.applyStereotype("Persistence::Entity") -> entity.setTaggedValue("Persistence::Entity", "tableName", entity.name.asTableName())-> entity.testAndAssignInheritanceStrategy()-> entity.attribute.select(a|a.association==null).adaptAttribute() -> entity.attribute.select(a|a.association!=null).adaptRelation() -> entity; //In case the entity extends another class, assigne the persistence stereotype for //strategy on the uml::Generalization //TPC="TABLE_PER_CLASS" | J="JOINED" | ST="SINGLE_TABLE"; Void testAndAssignInheritanceStrategy(RDMProfile::Entity this): if !general.isEmpty then assignInheritanceStrategy(); Void assignInheritanceStrategy(RDMProfile::Entity this): let gener = generalization.first(): gener.applyStereotype("Persistence::"+getInheritanceStrategyFromDardl().mapToStrategy()) -> if(getInheritanceStrategyFromDardl() == "SINGLE_TABLE") then ( gener.setTaggedValue("Persistence::TablePerClassHierarchy", "discriminator_value", getDiscriminatorValue())-> gener.setTaggedValue("Persistence::TablePerClassHierarchy", "discriminator_superClass_column", gener.general.name+"_type")-> gener.setTaggedValue("Persistence::TablePerClassHierarchy", "discriminator_superClass_type", "INTEGER") ) ;
  • 33. AOP with templates and functions «AROUND org::fornax::cartridges::uml2::javabasic::templates::Documentation::documentation FOR uml::Classifier» «targetDef.proceed()» «EXPAND JPAAnnotations» «ENDAROUND» «DEFINE JPAAnnotations FOR Persistence::Entity» @javax.persistence.Entity @javax.persistence.Table(name="«asTableName()»") «EXPAND InheritanceAnnotations» @javax.persistence.NamedQueries({ @javax.persistence.NamedQuery(name="find«name»s", query="SELECT e from «name» e") }) «IF !isAbstract» @javax.persistence.EntityListeners («getQualifiedPackageName("ListenerOnce")».«name»ValidationListener.class) «ENDIF» «EXPAND UniqueConstraints» «ENDDEFINE» around org::fornax::cartridges::uml2::javabasic::extensions::DataType::NormalizedDefaultValue( uml::Property property): internal_getNormalizedDefaultValue(property); private String internal_getNormalizedDefaultValue (uml::Property property) : JAVA gts.ise.refdata.oaw.fornax.util.Extensions.getNormalizedDefaultValue(org.eclipse.uml2.uml.Property);
  • 34. Arange your ideas Motivation: Managing Manual Code
  • 35. Sucessfully applied MDSD best practices ! Separate generated from manual code ! Avoid check-in generated code src BaseClass BaseClass manually written src-gen AbstractA AbstractB AbstractB AbstractD always generated ConcreteA ConcreteA src-once Some ConcreteB Some ConcreteB ConcreteC ConcreteD Manual Manual generated once Code Code
  • 37. Design your tools Motivation: Managing Generator Complexity
  • 38. Reference Implementation ! Manually implemented ! Far more than a prototype! ! Compilable, deployable, executable, testable ! Covers every architectural concept ! Code seperated in to-be-generated and manual code
  • 39. Reference Model ! Contains every supported modeling concept ! Not necessary excerpt from the real domain, but helps for understanding ! Try to minimize the model size
  • 40. Testing the reference ! Reference Implementation is tested intensively and automatic ! Unit tests and integration tests with high coverage ! Tests against generated artifacts ! Real application does not need to be tested in the same extend
  • 41. generated from reference model manually implemented reference
  • 42.
  • 43. Model metrics Associations Attributes Entities
  • 44. Motivation: Optimizing Generator Speed and Readability
  • 45. Refactorings / Profiling ! Reference Implementation/Unit-Tests ensure valid output ! Static Typing of Xpand supports development
  • 51. Most significant problems ! Repeated calls of functions ! Suboptimal algorithms/data structures ! Branches with best-case scenarios ! Profiling reduced generation time from 28 min downto 3 min
  • 53. Value of Cartridges ! Project benefited from cartridges developed by OS community ! But: Largest part of the code generators are totally project dependent
  • 54. Early adopters ! Using the bleeding edge of Eclipse Modeling was challenging ! But: Continuous improvement of used technologies thanks to direct feedback with OS community ! And: Significant performance and stability gains since early adoption
  • 55. Learning curve ! Establishing MDSD and tools was hard for unexperienced developers at the beginning ! But: Coaching helped to fill the gap fast ! And: Now developers educate others to use MDSD tooling
  • 56. Reference Implementation ! Reference Models and Reference Implementation are invaluable ! Reducing the complexity ! Enable refactoring ! But: Effort to create and maintain a real Reference Implementation quite high