Model Transformation A Personal Perspective

410 views
342 views

Published on

Keynote at AMMA 2006

Published in: Technology
3 Comments
1 Like
Statistics
Notes
  • Mindsight: The New Science of Personal Transformation --- http://amzn.to/1R9Puk5
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Personal Transformation: A Practical Guide To Unleash Your True Potential: Personal Growth: Achieve Self Mastery In Every Area of Your Life: Personal Growth, Motivation, Confidence --- http://amzn.to/1Mvtxrt
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Personal Transformation: 21 Days To A New Mind: 3 in 1 Boxset for Personal Transformation (Gratitude, Limiting Beliefs & Healing) --- http://amzn.to/1WAkWtd
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
410
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
6
Comments
3
Likes
1
Embeds 0
No embeds

No notes for slide

Model Transformation A Personal Perspective

  1. 1. Model TransformationA Personal PerspectiveEdward D. Willinked@willink.me.ukGMT Consortiumwww.eclipse.orgalso Thales Research and Technology (UK)edwillink@iee.orgAMMA 2006
  2. 2. 3 May 2006 Model Transformation - A Personal Perspective 2Outline●Background− personal− embedded rather than mainstream●different perspectives/tools− diagrams and their meaning●Current− convergence●same problems●Future Challenges− meta-model semantics− meta-model management− transformation efficiency
  3. 3. 3 May 2006 Model Transformation - A Personal Perspective 3BackgroundElectronic EngineerRacal Research -> Thomson CSF Racal -> Thales Research and TechnologyDSP, DSP toolsWDL specification language proposalComputer ScientistPhD - better DSP toolsDSP compiler optimisationMeta-compilation for C++Open SourcePtolemy Caltrop - actor definition languageSourceForge NiceXSL - friendly front end for XSLTEclipse GMT - UMLX graphical transformation ideasEclipse OMELET - transformation integration - MDDIEclipse GMT - UMLX realisation
  4. 4. 3 May 2006 Model Transformation - A Personal Perspective 4Experience●Embedded Signal Processing− Comparatively simple code●Simple programming techniques●Prejudice for efficient languages− Slow to move from assembler to C to C++− Very reluctant to accept Java− Comparatively complex architectures●Numerous communicating subsystems− Diagrams always important to explain behaviour●Mainstream Programming− Comparatively complex code− Comparatively simple architectures●But Embedded world now wants− Complex code – protocol stacks ...●But Mainstream world now wants− Complex architectures – networks, threads ...
  5. 5. 3 May 2006 Model Transformation - A Personal Perspective 5Basic Analogue Circuit●Transistor Amplifier− each graphical element is almost a physical element
  6. 6. 3 May 2006 Model Transformation - A Personal Perspective 6Hierarchical Analogue Circuit●Op Amp high level symbol to control complexity
  7. 7. 3 May 2006 Model Transformation - A Personal Perspective 7Analogue ComputerMore Abstract – Model - Sinewave generator continuous time, continuous level
  8. 8. 3 May 2006 Model Transformation - A Personal Perspective 8Systems
  9. 9. 3 May 2006 Model Transformation - A Personal Perspective 9Block Diagrams●Low, medium or high level●Friendly Convey an apparently simple meaning Open to review●Each element Independent continuously operating
  10. 10. 3 May 2006 Model Transformation - A Personal Perspective 10Continuous Timeappropriate model for− audio, radio, ... continuous signalsinappropriate model for− sporadic events− push buttons− GUI interactions− power failures− interrupts− protocol messages− video, ... sampled signalsdedicated resource− always processing− infinite power processing element
  11. 11. 3 May 2006 Model Transformation - A Personal Perspective 11Discrete Time●shared resource− process occasionally− finite processing element●discrete time suitable for digital computers− predictable, reliable, ...●continuous time impossible on digital computers− create an illusion of continuous time●high enough sample rate (Nyquist)●Two practical forms of discrete time− sporadic events/messages●state machines/protocols− regular samples/tokens●Digital Signal Processing
  12. 12. 3 May 2006 Model Transformation - A Personal Perspective 12Block Diagram Semantics●computation− easy, only software●{inputs, state} -> {outputs, state}− soluble in most languages●communication− collaboration between sender and receiver− soluble in few languagesBlock Block Blockinputs outputsstate
  13. 13. 3 May 2006 Model Transformation - A Personal Perspective 13Function Modelling●An unsuccessfularea for graphics− ProgramFlowcharts− Schlaer-Mellorflow diagrams− SDL
  14. 14. 3 May 2006 Model Transformation - A Personal Perspective 14Transformations as Program Steps●Generic state-based transactionstate stateMxinputs outputsstate stateinputs[constraint]/outputs
  15. 15. 3 May 2006 Model Transformation - A Personal Perspective 15Component Oriented Communications●provide a sink/sourceloop foreverwait till inputs availableget inputscompute outputs and update stateput outputsBlockinputs outputsstate
  16. 16. 3 May 2006 Model Transformation - A Personal Perspective 16Trivial Deadlock●Oops− both waiting for inputs− neither generating output●Deadlock (with just 2 components!)BlockAinputs outputsstateBlockBinputs outputsstate
  17. 17. 3 May 2006 Model Transformation - A Personal Perspective 17System Oriented Communications●Component Oriented Communications (One Ended)− system utility is not my problem− deadlocks, livelocks are your problem− difficult/intractable analysis− component is not (re-)usable●System Oriented Communications (Two Ended)− communication policy carefully chosen●suitable communication rates●suitable communication resources/bandwidths/routes●compliant sources and sinks on each end− tractable synthesis●?? cf. Service Oriented Architectures ??
  18. 18. 3 May 2006 Model Transformation - A Personal Perspective 18The MDA YPSMwhat actually gets done -- the codePlatformIndependentModelPlatformSpecificModelPlatformModelPlatformModelPIMwhat needsto be doneprogram/applicationmodelswhat resourcesare availableprogram/algorithm/applicationlibrarieshardware/operating systemdefinition models
  19. 19. 3 May 2006 Model Transformation - A Personal Perspective 19The less publicised MDA YMM - the manual intervention, so thatPSM - the 100% autogenerated solution●do the JPEG on the graphics processor●use a non-reentrant QuickSort algorithm for ...●use TCP to satisfy transmission guaranteesPIMPSMPlatformModelPlatformModelMarkModel
  20. 20. 3 May 2006 Model Transformation - A Personal Perspective 20Some Specification-based Problems●Types− missing type inference− type checking− implementation type selection●Computation− algorithms●Communications− protocol/route/speed/...●Scheduling− Heavyweight/lightweight/no OS/...− priority/schedule●Partitioning− processor type/choice/count/configuration− activity to process to processor allocation
  21. 21. 3 May 2006 Model Transformation - A Personal Perspective 21The Aspect Oriented YTransformationsmuch too complexfor one passMultiple passesvariouslyDS(V)L or UMLCIMPIMPSMCodePIMa PMaMMaConcern APIMb PMbMMbConcern BPIMc PMcMMcConcern CPIMd PMdMMdConcern DPSM
  22. 22. 3 May 2006 Model Transformation - A Personal Perspective 22Transformations Everywhere[... from requirementsvia vague specificationto executable specification]●Hundreds of transformations from:− executable specification to implementation (code)●Code to executable− currently hidden inside compilers− could be exposed as hundreds of transformations●could then be customised for special purposes●could be optimised one transformation at a time
  23. 23. 3 May 2006 Model Transformation - A Personal Perspective 23Future Challenges●Today− single fully functional transformation difficult●ATL (First committed to CVS 5-Nov-2004)− increasing utility, annual workshop/conference− significant scaleability limitations− first meta-model/transformation library (zoo)●VIATRA2 (One-off commit to CVS 20-Oct-2005)− significant local usage●QVT - ? coming soon ?●Tomorrow− multiple transformations common-place− effective usage will be the problem
  24. 24. 3 May 2006 Model Transformation - A Personal Perspective 24●meta-models defines the information content●models conform to their meta-modelMeta-Model SemanticsMa MbMMa MMbMMxin outusesusesconforms toconforms toMOFMx
  25. 25. 3 May 2006 Model Transformation - A Personal Perspective 25●Mx author has detailed knowledge of MMa and MMb− knows that●days of month count from 1●days of week count from 0 and that 0 is Sunday●name is a Java identifier and so cannot be “class”●negative numbers use parentheses●pressure is in foot-poundsSingle-Use Custom TransformationMa MbMMa MMbMMxin outusesusesMx
  26. 26. 3 May 2006 Model Transformation - A Personal Perspective 26MxMultiple Re-usable TransformationsMa MbMMa MMbMMxin outusesusesMb McMMb MMcMyMMyin outusesusesMMb ≡ MMb ?Mb ≡ Mb ?
  27. 27. 3 May 2006 Model Transformation - A Personal Perspective 27Compatible Transformations●MMb ≡ MMb, Mb ≡ Mb− transformations can be cascaded− no problem− never going to happen universallyMa MbMMa MMbMMxin outusesusesMcMMcMMyin outusesusesMx My
  28. 28. 3 May 2006 Model Transformation - A Personal Perspective 28Incompatible Transformations●MMb ≠ MMb or Mb ≠ Mb run-time: need a further transformation Mz compile-time: need to know that we need a furthertransformation Mz -- type checkingMa MbMMa MMbMMxin outusesusesMb McMMb MMcMMyin outusesusesMMzusesusesoutinMx MyMz
  29. 29. 3 May 2006 Model Transformation - A Personal Perspective 29Model incompatibilites●MMb ≡ MMb, Mb ≠ Mb− Location●repository / file system− Format●XML / textual− Version●XMI 1.x / XMI 2.y− Medium●File / Stream / DOM / EMF / ...●Soluble with libraries of conversion transformations− no conversion of meta-model semantics is performed− just a conversion/movement of model representation
  30. 30. 3 May 2006 Model Transformation - A Personal Perspective 30OMELET solution●Transformations typed with an interface signature:− Mx transformation model: Java●input model: DOM representation of MMa●output model: OutputStream representation of MMb My transformation model: XSLT2●input model: InputFile representation of MMb●output model: OutputStream representation of MMc●OMELET deduced from conversion library− Mz transformation model: Java●input model: OutputStream representation of MMb●output model: InputFile representation of MMb
  31. 31. 3 May 2006 Model Transformation - A Personal Perspective 31Meta-Model incompatibilities●Conversions of representations/locations are easy●Conversion of semantics is important− but only where sensible− banking models and atomic models are incompatible●Mappings− 1:1 correspondences with trivial changes●Semantics rewrites− more substantial changes●Should be checkable●Should be auto-generatable
  32. 32. 3 May 2006 Model Transformation - A Personal Perspective 32The Re-usability problem again●If any aspect of MMb to MMb relationship notmachine processable:− need manual assertion/selection of Mx then My●Just another form of uncheckable programming●∴ every aspect of MMb to MMb definedMxMa MbMMa MMbMMxin outusesusesMb McMMb MMcMyMMyin outusesuses
  33. 33. 3 May 2006 Model Transformation - A Personal Perspective 33Semantic DomainsEach semantic element needs its own meta-model− some very simple:●Numeric unit meta-model scale factor with respect to an SI standard for units●Name spelling meta-model regular expressions●Name scoping and hierarchy meta-model predicate logic for ...●Each domain uses an appropriate mathematics●In so far as possible each domain is orthogonal− spelling convention for employee names independentof responsibilities of each job
  34. 34. 3 May 2006 Model Transformation - A Personal Perspective 34Not so Simple Domains●Even numbers are not-trivial− scale factor /unit− maximum/minimum values− resolution− accuracy/precision/distribution− overflow behaviour− rounding/underflow behaviour●Meta-model may be relatively vague− just a length●System specification (PIM) may imply− maximum/resolution●Mark model may impose− precision●Platform Model may offer− types with maximum/minimum/resolution/...
  35. 35. 3 May 2006 Model Transformation - A Personal Perspective 35Really not Simple Domains●Fowler: Analysis Patterns ...●Number becomes a Measurement− what - the measurement− who - the operator/equipment− when - time ..− where ...− why - in response to request ...− validated by ...− ...
  36. 36. 3 May 2006 Model Transformation - A Personal Perspective 36Semantic Domain Resolution●Semantic conversions can be automated− Fahrenheit to Centigrade− Name mangling policy for illegal names●C++ identifiers in C are marginally readable●With a defined semantic language− conversion transformations for each semantic
  37. 37. 3 May 2006 Model Transformation - A Personal Perspective 37Custom Semantics●Different enterprises have special requirements− banking●no lost fractional pennies/cents - COBOL− security●no confusion of red/black data●data independent execution time●erasure of all temporary memory●minimised parasitic radio emissions− integrity●guaranteed response time●guaranteed sub-system independence− system●low power consumption/size/...
  38. 38. 3 May 2006 Model Transformation - A Personal Perspective 38Subset Semantics Requirement●Ideally transformations proven to be applicable− to all possible input models●Pragmatically transformations may be applicable− to many useful input models●For instance− UML to RDBMS●only applies to UML classes●definitely not applicable to UML use cases●dubiously applicable to UML inheritance− UML to Java●not applicable for certain class names
  39. 39. 3 May 2006 Model Transformation - A Personal Perspective 39Subset Semantics Solution●Mx is not valid for all Ma:MMa -> Mb:MMb− is it valid for Mc:MMc where MMc ⊂ MMa ?●Proof of applicability− ? semantic meta-models●Sub-set applicability− can be defined by a sub-set meta-model●UML except {use cases ...}●MMc = MMa - ...− can be defined by a constrained meta-model●UML except certain names to satisfy Java semantics●MMc = MMa ⋂ ...− requires support for meta-model refinement●MOF package merge ...●MMc = MMa ⋃ ...
  40. 40. 3 May 2006 Model Transformation - A Personal Perspective 40Extensible Semantics●One commonality between different requirements− all different●Custom tools for each requirement undesirable− COBOL●Need to extend existing tools to new semantics− not rewrite for each new semantic
  41. 41. 3 May 2006 Model Transformation - A Personal Perspective 41Semantic Satisfaction●Characteriseeach semantic property for each transformation :− each property is●established/destroyed/preserved/undefinedby each transformation●Satisfactory chain ends− {dont care}*, establish, {preserve}*for each required property●Given the source models (and meta-models)a library of transformationsrequired properties− valid transformation chain can be deduced
  42. 42. 3 May 2006 Model Transformation - A Personal Perspective 42Efficient composition●Single Transformations− potentially inefficient●arbitrary pattern matching●amenable to pragmatic constrained approaches●Cascades of hundreds of transformations− potentially very very inefficient●numerous intermediate models− potentially very efficient●semantics/intent of declarative transformations known●multiple transformation passes can be combined●Graph Transformation Theory can prove validity− slow execution instantly− fast execution after optimised composition●custom compiler
  43. 43. 3 May 2006 Model Transformation - A Personal Perspective 43Summary●Different programming worlds converging on MDA●Todays problems should become irrelevant●Tomorrows problems look interesting− are Txs the new programming language?− are Tx chains deducible?− is reusable software finally going to happen?

×