Consolidation of the Generator Infrastructure MDGEN Model Driven Generation Date: October 16 th, 2012 Produced by: Mario Lovisi / Serano Colameo Version: 1.0 DRAFT
Agenda Initial Situation / Goal of the Project (Mario Lovisi) The Multi Channel Platform (MCP) IcmDsl & MDGEN Features Q&A (Mario Lovisi) (Serano Colameo) (Mario Lovisi / Serano Colameo) Date: 18/10/2012 Slide 2
Initial Situation Generator Artifacts Model Technology TOOLS GenCAL JBSGEN Data Service Framework EJB 2.x conform Java Code for Standard, FN and MCP Services EJB 2.x conform Java Code for FN Classic Services EJB 3.x conform Java Code and Persistence Layer stuff for FN Java Code XML / DTD XML / XSD Velocity and Recoder Framework oaw 3.x (Xpand only) oaw 4.x (Xpand and Xtend 1.x) Date: 18/10/2012 Slide 3
Initial Situation Generator Artifacts Model Technology TOOLS GenCAL JBSGEN Data Service Framework EJB 2.x conform Java Code for Standard, FN and MCP Services EJB 2.x conform Java Code for FN Classic Services EJB 3.x conform Java Code and Persistence Layer stuff for FN Java Code XML / DTD XML / XSD Velocity and Recoder Framework oaw 3.x (Xpand only) oaw 4.x (Xpand and Xtend 1.x) Date: 18/10/2012 Slide 4
Goal of the Project Unify existing Generator Technologies in one Technology (Xtext) To be able to include existing code (Java) and models (e.g. IDL) Import existing interface definitions (IDL) into the new DSL (ICM) Generate for MCP more artifacts (Façade Implementation, Data Mappers, Transfer Object Handler, Commands etc.) as before Allow a model-driven migration (e.g. EJB2 => EJB3, JAP etc.) Date: 18/10/2012 Slide 5
What is the Multi Channel Platform? MCP is a pragmatic Cooperation Model for Business to increase effectiveness and synergies by: aligning business needs across channels aligning new IT initiatives concerning channel application within business reusing existing business functionality ensure consistency of functionality and data across channels an Integration Platform for IT to increase efficiency by sharing functionality, expertise and resources. Date: 18/10/2012 Slide 6
MCP Façade Technology Architecture Concept A façade is a design pattern, that provides a consistent interface for client applications and contains comprehensive logic to be reused: Date: 18/10/2012 Slide 7
Agenda Initial Situation / Goal of the Project (Mario Lovisi) The Multi Channel Platform (MCP) IcmDsl & MDGEN Features Q&A (Mario Lovisi) (Serano Colameo) (Mario Lovisi / Serano Colameo) Date: 18/10/2012 Slide 8
Targets XJCB CAL DSF... 1 st Step: Analysis, Separation of Concerns Middlewares FN Service Host FN Service DB FN Security GCRM MCP Facade Standard Svc Host Test Cases Cross Cutting Concern Technische Subdomain 1 (Backend) Technische Subdomain 2 (Services) Technische Subdomain 3 (Frontend) Metamodell 1 Modell Metamodell 2 Modell Metamodell 3 Modell Date: 18/10/2012 Slide 9
2 nd Step: Define Runtime Usage of the MDGEN Tools Features: +EJB3 +JUnit4 JDK and JAP is automatically recognized by the Generator! Java Artefacts including tests Developer -XML... Config build.xml (ant, qmb) execute MDGEN Generator (ant task) files build properties Eclipse: JDT, EMF generator properties EJB xml files... Date: 18/10/2012 Slide 11
3 rd Step: Design DSL and Generator Architecture Interface Component Model as a Domain Specific Language Icm Dsl Built-in and extendable Type System with Mapping Functionalities Java is directly supported as Model (Jvm-Model) in IcmDsl IDL can be Im ported (transformed) into IcmDsl (model-2-model & model-2-text) Other Artifacts can be imported as well (we stopped with WSDL) Refer existing Java code Java ICM m2m transformation Service/Component Mapping Modell Icm DSL UML Source Models (existing artifacts) Persistence Modell XSD IDL WSDL... Realized = red Disabled = green Date: 18/10/2012 Slide 12
Date: 18/10/2012 Slide 13
IcmDsl definition of exceptions inheritance and versioning concept types and constant bind java types Use of Annotation mapping of existing data structures definition of components Date: 18/10/2012 Slide 14
Generic Java Generator Architecture Java Meta Model JMM IcmDsl Files Platform Independent to Platform Specific Model association JVM Model Java m2t transformation m2m transformation Model 2 Text Templates Model 2 Model m2t transformation Date: 18/10/2012 Slide 15
Generated Artifacts Service Layer: Interface, Implementation, Delegator, Helper Classes Transport Layer: Transfer Objects, Transfer Object Handler, Command Classes Business Layer: Business Objects, Data Mapper Classes Data Layer: XJCB Services (Java Corba Bridge Service Artifacts) JUnit Tests for each Service Operation Deployment Descriptors Configuration Files (XML)... Use of Generation Gap Pattern to allow manual enhancement All needed Service Artifacts are automatically generated Mapping of Business and Transfer Objects can be also generated Only complex Business Logic must be manually implemented Date: 18/10/2012 Slide 16
Migration of Existing MCP Façade Services Change Technology Stack: EJB2.1 => EJB3, JAP6 => JAP7 JDK and JAP is automatically recognized by the Generator! Generator Switches Features: +EJB3 +SkeletonOnly... Date: 18/10/2012 Slide 17
Migration of Legacy Services (Java Corba Bridge JCB) Source IDL Grammar IDL Metamodel Zip Files scan & extract IDL- Files parse conforms import: m2m & m2t Target generate & build Artefacts (Java, Doc, ) IcmDsl We m igrated over 300 existing JCB services by just im porting and regenerating all existing artifacts in one step! Date: 18/10/2012 Slide 18
Mapping of Tier Layer Data Structures Enterprise Architectures consists of many Layers... Mapping of Data Structures Date: 18/10/2012 Slide 19
Mapping and Binding of existing Models and Artifacts Java Mapping of Java types (classes) Mapping of IcmDsl Types (class, structure etc.) Icm Dsl IDL Binding of IDL Types/Interfaces Date: 18/10/2012 Slide 20
Mapping (i) of Model and/or Java Types in Combination IcmDsl: Generated Java Code: Date: 18/10/2012 Slide 21
Mapping (ii) of Model and/or Java Types IcmDsl: Generated Java Code: Mapping of field definitions with conversion/populate methods Date: 18/10/2012 Slide 22
Mapping (iii) Type Selection with the "."-Dot-Notation IcmDsl: Generated Java Code: Mapping of Types on Field definitions using the dot (".") notation. Cardinality is of course also supported Date: 18/10/2012 Slide 23
Mapping of Service Structures to Business Objects Business Object Service Data Structure Data Mapper Date: 18/10/2012 Slide 24
Mapping of Business Objects to Transfer Objects Data Mapper TO Handler Mapping of Business Objects fields to Transfer Objects allows no type conversion No «select» keyword means map all fields Date: 18/10/2012 Slide 25
Mappings are managed by Data Mappers Service / Operation Data Mapper Name Reference existing Java Service Structure Bind a BO to a Data Mapper with annotation Date: 18/10/2012 Slide 26
MCP Location Specific Customization (I) Reusing of façade API and business logic but with different backends! Switzerland? Singapore Date: 18/10/2012 Slide 27
MCP Location Specific Customization (II) Customization of Data Mapper Definitions by extending the model and tagging them Switzerland Singapore Date: 18/10/2012 Slide 28
Questions Date: 18/10/2012 Slide 29