OCL - The Bigger Picture

Embed Size (px)

DESCRIPTION

Keynote at BigMDE 2013

Citation preview

  • 1. Made available under EPL 1.0OCL - The Bigger PictureEdward Willink, Willink Transformations LtdEclipse Projects: OCL, MMT, QVTd, QVTo, UMLXOMG RTFs (representing Nomos): OCL, QVT, UMLBigMDE 2013, Budapest17th June 2013

2. 17-June-2013 OCL - The Bigger Picture 2Made available under EPL 1.0OverviewBig MDEbig problemsdisproportionately big problemsSmall MDEsmall problemsinsignificant in the smallsignificant in the largeBig MDEdisproportionately small problems 3. 17-June-2013 OCL - The Bigger Picture 3Made available under EPL 1.0BackgroundElectronic/Systems Engineeringpoor quality toolsmake things bettermake things reuseablemake things rightspecification not implementation 4. 17-June-2013 OCL - The Bigger Picture 4Made available under EPL 1.0OCL utilityexecutable specification languagerightuseablereuseableunuseableside effect freenothing can changeneeds objectsonly useful within a larger contexttransformation languages 5. 17-June-2013 OCL - The Bigger Picture 5Made available under EPL 1.0Systems 6. 17-June-2013 OCL - The Bigger Picture 6Made available under EPL 1.0Block DiagramsLow, medium or high levelFriendly Convey an apparently simple meaning Open to reviewEach element Independent continuously operating 7. 17-June-2013 OCL - The Bigger Picture 7Made available under EPL 1.0SubsystemsSystems too complicatedbreak down in to subsystems/subsubsystems/...Subsystems availableadd value to create a SystemWhat does it actually mean to composesubsystems ?compatible interface .... communication 8. 17-June-2013 OCL - The Bigger Picture 8Made available under EPL 1.0Subsystem Interface CompatibilityContent compatibilityfeet/pounds or metres/kilograms ?model conforming to structural metamodeltypes conforming to semantic metamodelCommunication compatibilityproducer/consumerclient/server... 9. 17-June-2013 OCL - The Bigger Picture 9Made available under EPL 1.0Communication Link is two endedBoth ends must co-operateAll links must co-operateshare bandwidthavoid deadlocksreduce latenciesprovide securityprovide reliability.... 10. 17-June-2013 OCL - The Bigger Picture 10Made available under EPL 1.0Component Oriented Communicationsprovide a sink/sourceloop foreverwait till inputs availableget inputscompute outputs and update stateput outputsBlockinputs outputsstate 11. 17-June-2013 OCL - The Bigger Picture 11Made available under EPL 1.0Trivial DeadlockOopsboth waiting for inputsneither generating outputDeadlock (with just 2 components!)BlockAinputs outputsstateBlockBinputs outputsstate 12. 17-June-2013 OCL - The Bigger Picture 12Made available under EPL 1.0Eclipse System PerformanceEclipse 3.0 to 3.4 steadily fasterincremental editor/compilerincremental builderEclipse 3.5 to 3.9/4.3 steadily slowerinnovative new projectsindisciplined use of component-level APIs(e4 is far from being the major culprit) 13. 17-June-2013 OCL - The Bigger Picture 13Made available under EPL 1.0Stupid Livelock Example1: Every source file shall be reviewed after any change2: Every source file shall contain a review recordOops:real change =>review =>review record change =>review =>review record change => 14. 17-June-2013 OCL - The Bigger Picture 14Made available under EPL 1.0Real Example1: The Model Index shall contain a summary of all models2: The Model Index shall be updated when a model changes3a: The Model Index shall be accessible as a model3b: A model shall be autogenerated from ...3c: Another Model Index shall contain a summary of all models3d: A Configuration Management State ....In practice the infinite loop is only stabilized by:an unmodified output file shall not be written 15. 17-June-2013 OCL - The Bigger Picture 15Made available under EPL 1.0Communication DesignRequirements of the system=> partitioning of computations=> distribution over processes/processors=> requirements on the communicationscan be fundamentally relibaleBottom up subsystem reuse=> communication anarchyComponents must suit the system 16. 17-June-2013 OCL - The Bigger Picture 16Made available under EPL 1.0Mutable ComponentsImplementationsnumerous configuration options(very) bloated interfacescompromised performanceSpecificationsauto-generated implementationnumerous configuration optionsunwanted functionality gets optimized awayDead Specification Elimination 17. 17-June-2013 OCL - The Bigger Picture 17Made available under EPL 1.0Requirements SpecificationImplementation 18. 17-June-2013 OCL - The Bigger Picture 18Made available under EPL 1.0The basic software production problemSimpleProblemtoo hardprogressionsdistractionsmodelsSpecificationCodeAssemblerCCIMPIMPSMModelsMacroAssemblerC++, Java, ..Aspect ... 19. 17-June-2013 OCL - The Bigger Picture 19Made available under EPL 1.0MDA YPlatformIndependentModelPlatformSpecificModelPlatformModelPIMwhat needsto be doneprogram/applicationmodelswhat resourcesare availableprogram/algorithm/applicationlibrarieshardware/operating systemdefinition modelsPSMwhat actually getsdone -- the code 20. 17-June-2013 OCL - The Bigger Picture 20Made available under EPL 1.0Better MDA YSpecification + Hints + Reality => SolutionPlatformIndependentModelPlatformSpecificModelPlatformModelMark ModelMM - the manualintervention do the JPEG on thegraphics processor use a non-reentrantQuickSort algorithm for ... use TCP to satisfytransmission guaranteesPSM - the 100%autogenerated solution 21. 17-June-2013 OCL - The Bigger Picture 21Made available under EPL 1.0Aspect Oriented MDAToo many problems to solveat oncedivide and conquersolve one concern at a timeprecisionschedulingpartitioninglatencyintegritymiddlewarecode generationConcern ACodeModelsConcern BConcern CSpecificationConcern ZPlatform Hints 22. 17-June-2013 OCL - The Bigger Picture 22Made available under EPL 1.0MetaModel Typed MDAAll models conform to their meta-modelsM Ain MM AinM Aout MM AoutIn practice not all of meta-model is usedM Ain MM Ain MM AinM Aout MM Aout MM AoutM Bin MM Bin MM BinM Bout MM Bout MM BoutCompatibilityM Aout M BinMM Aout MM Bin[MM Aout MM Bin too strong]Concern ACodeMM AinModelsConcern BConcern CSpecificationConcern ZMM BinMM BoutMM AoutMM CinMM CoutMM ZinMM Zout 23. 17-June-2013 OCL - The Bigger Picture 23Made available under EPL 1.0Traditional ModelingUML Analysis Diagramspoor quality toolsmajor analysis/design disconnectUML Design Diagramsdifficult to capture behaviouropaque code generation templatestroublesome reverse engineering cyclesVery productive in well-suited narrow domainsstate/protocol machinesCounter productive in more general applications 24. 17-June-2013 OCL - The Bigger Picture 24Made available under EPL 1.0The Action ProblemAction code does not model wellAny systemhas a statecomprising many variablescan be represented as an instance of a meta-modelevent occurssometimes comprising a messagecan be represented as an instance of a meta-modelhas an updated statecomprising many variablescan be represented as an instance of a meta-model 25. 17-June-2013 OCL - The Bigger Picture 25Made available under EPL 1.0State change as model transformationAny state changecan be treated as an atomic model transformationfromold stateinput messagetonew stateoutput messagesModelTransformationInputMessageOutputMessage(s) 26. 17-June-2013 OCL - The Bigger Picture 26Made available under EPL 1.0In-place transformationsEmbedded systemsin-place transformation (human)old state can be accidentally corrupted while computing new statehybrid old/new state can be inadvertently accessedin-place transformation (declarative)tooling must sequence old reads, temp stores, new writestooling must hide access during finite duration atomic changeModelTransformationAInputMessageOutputMessage(s)ModelTransformationBInputMessageOutputMessage(s) 27. 17-June-2013 OCL - The Bigger Picture 27Made available under EPL 1.0Declarative model transformationRelationship between Input(s) and Output(s)no internal side effectsvery disciplined form of model mutationcan be expressed in OCLModelTransformationInputMessageOutputMessage(s) 28. 17-June-2013 OCL - The Bigger Picture 28Made available under EPL 1.0Model transformation as OCLself organizing (small changes)every node notifies changesevery node listens for relevant changesOCL analysis configures the listenerschange just ripples through affected graph nodesstrategic (large changes)transformation directly pokes the affected nodesOCL EquationsDirected GraphInput Objectsand MessagesOutput Objectsand Messages 29. 17-June-2013 OCL - The Bigger Picture 29Made available under EPL 1.0Models of CompuationHow, When, Why computations happenfundamental to Digital Signal Processinginsufficiently known more generallyLee, E.A., Messerschmitt, D.G.: Synchronous data flow.Proceedings of the IEEE 75(9), 12351245 (1987) 30. 17-June-2013 OCL - The Bigger Picture 30Made available under EPL 1.0Java Model of Computationdouble f(double x, double y)double p,q,r;p = x + 1;q = y - 1;r = p + q;return r;}When f is invoked (unknown mechanism)execution proceeds statement by statementResult is returned (unknown mechanism)Validity of variables is assumed to be okcommunication exists as a side effect 31. 17-June-2013 OCL - The Bigger Picture 31Made available under EPL 1.0Java Model of Computation - Oopsdouble f(double x, double y)double p,q,r;r = p + q;p = x + 1;q = y - 1;r = p + q;return r;}Validity of variables is no longer okcommunication failsmay get uninitialized variable warningin general, just get a malfunction 32. 17-June-2013 OCL - The Bigger Picture 32Made available under EPL 1.0System/subsystem viewData dependencies are now clearcannot misscheduleWhat happens when?no one right answer+ 33. 17-June-2013 OCL - The Bigger Picture 33Made available under EPL 1.0Continuous Time MoCExecuting on analogue hardwareeach partial computation has its own hardwareoccurs continuouslypropagation delay from input to output 34. 17-June-2013 OCL - The Bigger Picture 34Made available under EPL 1.0SimulationDedicated hardware per computationimpracticalinaccurate/unstableunnecessarily redundantSimulationfast enough to give comparable resultsshare hardware 35. 17-June-2013 OCL - The Bigger Picture 35Made available under EPL 1.0Data Flow MoCEach node processes when readyabsorbs a token from each inputproduces a token at each outputpropagation delay from input to output 36. 17-June-2013 OCL - The Bigger Picture 36Made available under EPL 1.0Synchronous Data Flow MoCAll input tokens appear at onceno need for physical tokenssynthesize a legal schedulep = x+1; q = y-1; r = p+q;q = y-1; p = x+1; r = p+q; 37. 17-June-2013 OCL - The Bigger Picture 37Made available under EPL 1.0Discrete Event MoCInputs may change one at a timevariables have persistent statex changes:p = x+1; r = p+q;y changes:q = y-1; r = p+q; 38. 17-June-2013 OCL - The Bigger Picture 38Made available under EPL 1.0Practical ConsequencesIncremental editorediting 10 line file has cost Tediting a 10,000 line can be