Advised reading MDA Explained The modeldriven architecture Anneke

  • Slides: 37
Download presentation
Advised reading: MDA Explained, The model-driven architecture, Anneke Kleppe, Jos Warmer, Wim Bast, Addison

Advised reading: MDA Explained, The model-driven architecture, Anneke Kleppe, Jos Warmer, Wim Bast, Addison Wesley (ETEW 681. 3*D 2 KLEP 2003) 1 Chapters 1 -3 Architecture and Modelling of Information Systems (D 0 I 71 A) Prof. dr. Monique Snoeck TOWARDS A COMPLETE INFORMATION SYSTEM: INTRODUCTION TO MODEL DRIVEN ENGINEERING 23: 58 Transformation Definition Transformation Tool

MDE approach 2 § Modelling domain model: What next? § Final output software Programmatic

MDE approach 2 § Modelling domain model: What next? § Final output software Programmatic implementation Automatic model-to-code generation (MDE) § Model-Driven Engineering § use a platform-independent model (PIM) to define a system's functionality § Use this PIM to generate platform specific models (PSM) and then code § Model-Driven Architecture § A set of architectural concepts enabling MDE Transformation Definition 23: 58 Transformation Tool

MERODE's use of MDE = model simulation 3 § JMermaid + Code generation tool

MERODE's use of MDE = model simulation 3 § JMermaid + Code generation tool § Used for model simulation § to automatically generate a ready-to-use software prototype § allows testing and refining the system model based on detected defects in the conceptual business model given its fully working prototype. § = Illustration of MDE can be used in general to generate (part of) the final software Transformation Definition 23: 58 Transformation Tool

Why Model Simulation ? 4 Transformation Definition 23: 58 Transformation Tool

Why Model Simulation ? 4 Transformation Definition 23: 58 Transformation Tool

5 Requirements Code Transformation Definition 23: 58 Transformation Tool

5 Requirements Code Transformation Definition 23: 58 Transformation Tool

Agenda 6 § MDE Fundamentals § Development cycle § Building blocks § MDA Framework

Agenda 6 § MDE Fundamentals § Development cycle § Building blocks § MDA Framework § Current State Transformation Definition 23: 58 Transformation Tool

Software Development Life Cycle: Current Practice 7 Requirements Mostly Text Analysis Diagrams & Text

Software Development Life Cycle: Current Practice 7 Requirements Mostly Text Analysis Diagrams & Text Design Code Informal Formal Code Test Transformation Definition 23: 58 Transformation Tool

Problems with current practices 8 § Productivity § code is the driving force §

Problems with current practices 8 § Productivity § code is the driving force § XP: only coding and testing. How can an outsider understand how the code works ? § Portability § frequent new technologies § adopted because demanded, solve real problems, no support for older technologies § Complexity worsened by different versions, lack of backward compatibility § Interoperability § Systems do not exist in isolation § Individual Components use best technologies, but need to interact § Maintenance and documentation § time consuming task § benefit is ‘for others’ § ‘code is the documentation’ but high level documentation absolute must for complex systems Transformation Definition 23: 58 Transformation Tool

9 Software Development Life Cycle: MDA Practice Requirements Mostly Text Analysis Transformational Steps PIM

9 Software Development Life Cycle: MDA Practice Requirements Mostly Text Analysis Transformational Steps PIM Design PSM Code Informal Formal Test Transformation Definition 23: 58 Transformation Tool

10 MDE Development Life Cycle § PIM: Platform Independent Model § describes the system

10 MDE Development Life Cycle § PIM: Platform Independent Model § describes the system from a business perspective § PSM: Platform Specific Model § Specifies the system in terms of constructs available in a specific implementation technology § Transformational approach PIM Transformation Tool PSM PSM Transformation Tool Code Transformation Definition 23: 58 Transformation Tool

11 Compare with Zachman's Framework What 1 Contextual/ Scope 2 Conceptual/ Enterprise 3 Logical/

11 Compare with Zachman's Framework What 1 Contextual/ Scope 2 Conceptual/ Enterprise 3 Logical/ IS Functionality 4 Physical/ Design 5 As Built/ Subcontractor 6 Functioning/ Code How Who When Why PIM Platform Mapping Entity Input Relationship Process Entity Output 23: 58 Where PSM CODE Node Organization Event Line Reporting Cycle Node Organization Event Objective Precedent Objective Transformation Definition Transformation Tool

MDE Benefits 12 § Productivity § less code to be written § shift of

MDE Benefits 12 § Productivity § less code to be written § shift of attention from code to PIM to solving the business problem § BUT: development of transformations is hard ! § Portability § PIM is by definition completely portable § effective portability depends on available transformations § Interoperability § Documentation § PIM fulfils the role of high-level documentation § Tools needed for maintaining the relationships between PIM – PSM and Code § Still documentation required for PIM, e. g. motivation of choices Transformation Definition 23: 58 Transformation Tool

13 MDE Benefits § Productivity § reduce code & testing § increase design effort

13 MDE Benefits § Productivity § reduce code & testing § increase design effort § Requirements change § Prototype faster detect changes sooner la al s st ot he r n tio g in st Transformation Definition in te io ct tru en m ire ig n g ni n an re qu pl ot he tio la st al te s io ct tin in co ns tru de si en m qu ire an ni re pl 23: 58 ns 0% co 10% 0% de s 20% 10% rs 20% n 30% g 30% n 40% gn 40% ts 50% ng 50% ts 60% n Detected Requirements Changes Effort per project phase Transformation Tool

14 MDE Benefits § Interoperability First Transformation PSM PIM PSM Bridge PSM Second Transformation

14 MDE Benefits § Interoperability First Transformation PSM PIM PSM Bridge PSM Second Transformation Code First Transformation Code Bridge Code Transformation Definition 23: 58 Transformation Tool

Agenda 15 § MDE Fundamentals § Development cycle § Building blocks § MDA Framework

Agenda 15 § MDE Fundamentals § Development cycle § Building blocks § MDA Framework § Current State Transformation Definition 23: 58 Transformation Tool

MDE Required building blocks 16 § Well-specified high-level models: precise and complete § Languages

MDE Required building blocks 16 § Well-specified high-level models: precise and complete § Languages to write these high-level models § Definitions of how to transform a PIM into PSMs § custom made or publicly available § Definitions of how to transform a PSM into code § Languages to write these transformations § Tools to execute these PIM-PSM transformations § with features to tune and debug transformations § Tools to execute transformation of PSM to code Transformation Definition 23: 58 Transformation Tool

Agenda 17 § MDE Fundamentals § Development cycle § Building blocks § MDA Framework

Agenda 17 § MDE Fundamentals § Development cycle § Building blocks § MDA Framework § Current State Transformation Definition 23: 58 Transformation Tool

MDA Framework 18 § Models Transformation Definition 23: 58 Transformation Tool

MDA Framework 18 § Models Transformation Definition 23: 58 Transformation Tool

MDA Framework 19 § Languages § Entity Relationship Modelling § UML Class Diagram §

MDA Framework 19 § Languages § Entity Relationship Modelling § UML Class Diagram § Finite State Machines § Harel State charts § Business Process Modelling Notation § UML Activity Diagram § BPEL § Petri Nets § Use Case Diagrams Transformation Definition 23: 58 Transformation Tool

20 MDA Framework: Models § Different views in one Language (Single Model, multiple views)

20 MDA Framework: Models § Different views in one Language (Single Model, multiple views) § e. g. UML § Different Views/Models in different languages BPMN ER Written in Describes System 23: 58 System Transformation Definition Transformation Tool

MDA Framework: Models 21 § PIM versus PSM § e. g. Interaction diagram: §

MDA Framework: Models 21 § PIM versus PSM § e. g. Interaction diagram: § language independent platform independent ? § object oriented platform specific ? § Process-Data CRUD-Matrix § language independent platform independent § transforms to any technology platform independent § Models are more or less platform 23: 58 independent/specific Transformation Definition Transformation Tool

22 MDA Framework: Transformations § A transformation is the automatic generation of a target

22 MDA Framework: Transformations § A transformation is the automatic generation of a target model from a source model according to some transformation definition § A transformation definition is a set of transformation rules § Transformation definitions are between languages § A transformation rule defines how one or more constructs in the source language can be transformed into one or more constructs in the target language Transformation Definition PIM Transformation Tool PSM PSM Transformation Definition Transformation Tool Code Transformation Definition 23: 58 Transformation Tool

MDA Framework: Transformations UML Class Diagram UML Class D to Eiffel Transformation UML Class

MDA Framework: Transformations UML Class Diagram UML Class D to Eiffel Transformation UML Class D to SQL Transformation 23: 58 Customer > owns < owned_by 1. . 1 SQL DDL Account 0. . ID : INTEGER Name: STRING Eiffel 23 Class Customer Owns: Linked_list (ACCOUNT) … ID: INTEGER name: STRING … End Create Table Customer ("ID" "integer", “name” “char(50)”) Balance: real Deposit (amount: real) Withdraw (amount: real) Class Account Owned_by: CUSTOMER … balance: REAL Deposit (amount: real) is … Withdraw (amount: real) is … End Create Table Account (“Customer_id” “INTEGER”, “balance” “DOUBLE”, …) Transformation Definition Transformation Tool

MDA Framework: Transformations UML Collaboration Diagram UML Coll. D to Eiffel Transformation UML Coll.

MDA Framework: Transformations UML Collaboration Diagram UML Coll. D to Eiffel Transformation UML Coll. D to SOAP Transformation 23: 58 ATM withdraw(100 €) Eiffel SOAP 24 Account: 123 -456789 -10 This. Account : = Account. List. Find(123 -45678910) This. Account. withdraw(100) <<SOAP-ENV: Envelope xmlns: SOAP-ENV = http: //schemas. xmlsoap. org/soap/envelope/ SOAP-ENV: encoding. Style = "http: //schemas. xmlsoap. org/soap/encoding/"/> <SOAP-ENV: Body> <m: Notify. Withdraw xmlns: m="http: //www. bank. com/"> <Acount. ID> 123 -456789 -10 </Account. ID> <amount> 100 </amount> <currency> Euro </Currency> </m: Notify. Withdraw </SOAP-ENV: Body> </SOAP-ENV: Envelope> Transformation Definition Transformation Tool

Agenda 25 § MDE Fundamentals § Development cycle § Building blocks § MDA Framework

Agenda 25 § MDE Fundamentals § Development cycle § Building blocks § MDA Framework § Current State Transformation Definition 23: 58 Transformation Tool

MDA Today - http: //www. omg. org/mda 26 Transformation Definition 23: 58 Transformation Tool

MDA Today - http: //www. omg. org/mda 26 Transformation Definition 23: 58 Transformation Tool

MDA Today: Standards & Languages § § § 27 UML: for PIMs and PSMs

MDA Today: Standards & Languages § § § 27 UML: for PIMs and PSMs OCL: Object Constraint Language (for PIM) Action Semantics Profiles: define languages derived from UML, mostly suited for PSMs MOF: language used to define other languages QVT= standardized language to define transformations Transformation Definition 23: 58 Transformation Tool

28 MDA Today: Tools § § PIM to PSM transformation tools PSM to Code

28 MDA Today: Tools § § PIM to PSM transformation tools PSM to Code transformation tools PIM to Code transformation tools Tunable Tools Transf. D ef. Editor Model Editor Transformation Tool Code File Generat or Code Files Interchange of Models (in XMI, JMI or IDL) and Transformation Definitions Transf. D ef. Reposito ry 23: 58 Model Validator Model Reposito ry Code File Parser Code Editor(ID E) Transformation Definition Transformation Tool

MDA Today - http: //www. omg. org/mda 29 Changes continuously … Transformation Definition 23:

MDA Today - http: //www. omg. org/mda 29 Changes continuously … Transformation Definition 23: 58 Transformation Tool

30 MDA Problems § Redundancy § more specialized artifacts, multiple representation of same object.

30 MDA Problems § Redundancy § more specialized artifacts, multiple representation of same object. § Rampant Round Trip Problems § several models for one object ==> propagation of change § Manual propagation § bottom up propagation of change § Forward engineering is the easy part … § Moving Complexity rather than reducing it ? § inherent versus accidental/spurious § MDD solves versus moves complexity ? § Traceability problems § More expertise required § business user, analyst and developer need to understand the impact of a proposed change on all the related artifacts 23: 58 Transformation Definition Transformation Tool

31 MDA languages § UML 2. 1 has become enormous and unwieldy § complexity

31 MDA languages § UML 2. 1 has become enormous and unwieldy § complexity tends to impede successful adoption § some of the constructs in UML 2. 1 are nearly semantics-free (e. g. use cases). § semantics carry the meaning essential to enable automation § ==> lack of semantics at all levels makes the production of automated MDD tools difficult § DSL are not a fundamental solution: boil down to the same issues on semantics. Transformation Definition 23: 58 Transformation Tool

Key Success Factors for MDA 32 § semantics, SEMANTICS § Quality of the MODELS

Key Success Factors for MDA 32 § semantics, SEMANTICS § Quality of the MODELS § Garbage In Garbage Out § Platform independent & Abstract ≠ imprecise & ambiguous! § Quality of the MAPPING § Quality In + Mess it up Garbage Out ! § Design § Software Architecture key to Adaptable & Flexible software § Mapping requires PERSISTENT MODELS, in machine readable form § 4 Layer Metamodelling Architecture § STANDARDS & TOOL Integration Transformation Definition 23: 58 Transformation Tool

Challenge : Quality of the PIM 33 § Unambiguity § Natural Language § Formal

Challenge : Quality of the PIM 33 § Unambiguity § Natural Language § Formal language § Completeness § PERSON =? STUDENT EMPLOYEE § STUDENT EMPLOYEE = ? Transformation Definition 23: 58 Transformation Tool

Challenge : Quality of the PIM 34 § In order for a model to

Challenge : Quality of the PIM 34 § In order for a model to be executable it needs to be § Consistent § Method named “Ship” in OET, should be named “Ship” in FSM as well. § (sufficiently) complete § E. g. creating & ending methods required § Exercise: think of all consistency rules seen so far § “Check Model” § What would happen if a model does not satisfy these checks ? 23: 58 Transformation Definition Transformation Tool

MDA : Where to next ? 35 § CASE-tools were not as big as

MDA : Where to next ? 35 § CASE-tools were not as big as a success as promised § Computer Aided Software Engineering were either code-generation oriented, either based on 4 th generation languages § Transformations behind code generation were hidden and not adaptable Transformation Definition 23: 58 Transformation Tool

MDA : Where to next ? 36 § Will MDA be a success ?

MDA : Where to next ? 36 § Will MDA be a success ? Positive elements: § Growth of available tools (see OMG’s website) § Silo problem reduced § better integration of tools through XML standards § interpretation of XMI is still a problem == > semantics !! § more Open Source tools available § evolution to de facto standards § Transformations are open & customizable § Students trained at modelling with tools Transformation Definition 23: 58 Transformation Tool

37 MDA : Where to next ? § Will MDA be a success ?

37 MDA : Where to next ? § Will MDA be a success ? Negative elements: § Not Invented Here syndrome § Unwillingness to use artefacts made by other, based on the belief that in-house developments are inherently better suited, more secure or more controlled than existing implementations. § MDE easier for domain layer + part of ISS Layer, but way harder for user interfaces § User interfaces are rarely “standard” and often require customization by means of “manual” programming. § Wizard-based development – “Visual” programming § Eases programming and allows “fast” in-house development § Need for/belief in advantage of “automating” software production is not really high. 23: 58 Transformation Definition Transformation Tool