embedded ocl integration and debugging

Download Embedded OCL Integration and Debugging

If you can't read please download the document

Upload: edward-willink

Post on 24-Jun-2015

149 views

Category:

Travel


1 download

DESCRIPTION

Presentation at the OCL 2014 Workshop. Techniques used by Eclipse OCL to enable OCL to be used and debugged with a larger application.

TRANSCRIPT

  • 1. Embedded OCL Integration andDebuggingEdward WillinkWillink Transformations LtdEclipse FoundationMMT Component co-LeadOCL Project LeadQVTd Project LeadQVTo CommitterOMG (Model Driven Solutions)OCL 2.3, 2.4 (2.5) RTF ChairQVT 1.2, 1.3 RTF ChairOCL 2014 @ MODELS 201430th September 2014Made available under EPL 1.0

2. OverviewOCL Debuggingsource code stepping / visualizationOCL Integrationuse of OCL as part of a (much) larger applicationIntegrated OCL Debuggingdiagnosing OCL problems in the larger application30-Sept-2014 OCL Integration and Debugging Made available under EPL 1.0 2 3. OCL Debugger2013: Dresden OCL debugger2014: Eclipse OCL/QVTi debugger (Luna)Ecore OCLAcceleo Eclipse QVToPivot OCLQVTiQVTsQVTpQVTmQVTuEclipse QVTrDebuggerDebuggerEclipse QVTcDebuggerDebuggerEclipse Tools30-Sept-2014 OCL Integration and Debugging Made available under EPL 1.0 3 4. Launching a DebuggerJava etc, new processstart program in debug mode (with arguments)program acquires its dataIndependent OCL, new processstart OCL debugger (launch dialog)select (load) a Constraint / Expressionselect (load) some model objectsIntegrated OCL, ongoing processselect (re-use) a Constraint / Expressionselect (re-use) some model objectsstart debugger30-Sept-2014 OCL Integration and Debugging Made available under EPL 1.0 4 5. OCL ContextModels OCLComplete OCLParser Evaluator Editor DebuggerOCL useless by itself - no model accessComplete OCL - provides model accessUseful for learning / practiceReal models, real problems, real applications?30-Sept-2014 OCL Integration and Debugging Made available under EPL 1.0 5 6. Applications with embedded OCLModel API ModelsOCL APIEmbeddedOCLApplicationParser EvaluatorEMF model API - de facto standardEmbedded OCLUML - via Constraints(EMOF - via magic)Ecore - via EAnnotationsOCL API - tool/vendor-specific30-Sept-2014 OCL Integration and Debugging Made available under EPL 1.0 6 7. Debugging approachesApplicationModel API ModelsOCL API?Parser Evaluator OCL DebuggerHost DebuggerUse host debuggerverbose/semi-readable tooling codeUse 'printf' - e.g. oclLog()massive log filesEmbeddedOCLPractice expressions in an independent consolereplicate application content externallyUse independent debuggerreplicate application content externally30-Sept-2014 OCL Integration and Debugging Made available under EPL 1.0 7 8. Independent DebuggerModel API ModelsOCL APIEmbeddedOCLEvaluatorModels OCLComplete OCLreloadtranscribeParser, Evaluator, Editor, DebuggerReal Application Independent DebuggerApplicationReload models, transcribe OCLNo break points to help locate problemHard to select code to debugDifferent evaluator/models/...30-Sept-2014 OCL Integration and Debugging Made available under EPL 1.0 8 9. Debugging Use CasesSimple Object Re-useOCL injectionOCL constraintsAlternate validationEmbedded execution30-Sept-2014 OCL Integration and Debugging Made available under EPL 1.0 9 10. Simple Object Reuse(1)30-Sept-2014 OCL Integration and Debugging Made available under EPL 1.0 10 11. Simple Object Reuse(2)Modeling ResourceSet Resources EObjectsApplicationResources EObjectsselectionChangedsetSelectionOCL ISelectionApplicationEMF Modeling Applications use EMF EObjectsUI applications share selectionse.g. editor selection to outline viewOCL application can listen to selection changesreuse EObject30-Sept-2014 OCL Integration and Debugging Made available under EPL 1.0 11 12. Simple Object Reuse DebuggingModeling ResourceSet Resources EObjectsApplicationResources EObjectsselectionChangedsetSelectionOCL ISelectionApplicationOCLDebuggerOCL application (Console)reuses application objectsreloads/retypes constraintDebug button to execute constraint30-Sept-2014 OCL Integration and Debugging Made available under EPL 1.0 12 13. OCL injection (1)30-Sept-2014 OCL Integration and Debugging Made available under EPL 1.0 13 14. OCL Injection(2)EPackageResourceSet RReessoouurrcceess EEOObbjejecctsts ModelingApplication Resources EObjectsValidationRegistryDiagnostian Validatorsinstalluse ActioniterateoverOCL MenuEcoreconstraintsOCLEEEOOObbbjejjeeccctsttssconstraintsOCLValidatorsclickModelingResourceSet Resources EObjectsApplicationRReessoouurrcceess Resources EEOObbjejecctsts EObjectsEMF Modeling Applications use Diagnosticianper-EPackage Validation Registry Java codeAdditional menu actions can be contributedOCL action can add additional OCL constraints30-Sept-2014 OCL Integration and Debugging Made available under EPL 1.0 14 15. OCL Injection DebuggingNo OCL application for debugger to extendsee laterexplain OCL constraints first30-Sept-2014 OCL Integration and Debugging Made available under EPL 1.0 15 16. OCL Constraints (1)Ecore Constrainthand-coded Java - compiled models onlyEMF Delegated Constraintcode replaced by two stringsdelegate URI - selects the delegate technologye.g. "http://www.eclipse.org/emf/2002/Ecore/OCL"technology-specific constraint bodye.g. "loans->size()