Your SlideShare is downloading. ×
Eclipse OCL Summary
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Eclipse OCL Summary

3,048
views

Published on

Slides for the EclipseCon Europe 2011 Modeling Symposium BoF

Slides for the EclipseCon Europe 2011 Modeling Symposium BoF

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
3,048
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
60
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Eclipse OCL Summary Edward Willink Eclipse (MDT) OCL Project Lead, Eclipse (M2M) QVTd Project Lead Thales representive to OMG OCL RTF, Thales representive to OMG QVT RTF Modeling Symposium BoF 3rd November 2011
  • 2. MDT/OCL Project context Ecore Modeling Services in Java UML Modeling Services in Java Ecore, UML Execution Services in Java
  • 3. Executing/Using OCL
    • Use the Java API
    • 4. Use the Java debugger
      • OCL console
    • Use OCL in a model ??
      • embed OCL text as XML CDATA
      • 5. embed OCL text as EAnnotations
        • custom OCL genmodel templates
      • embed OCL text as EAnnotations
        • standard templates and EMF delegates (Helios)
  • 6. OCLinEcore editor
    • Xtext-based, full Ecore coverage
    • 7. Embedded OCL, validation messages
  • 8. Extended behaviour/OCL execution @Generated NOT manual Java (pre-Helios) EMF Delegates support EAnnotations (Helios) Direct OCL 2 Java (Juno) genmodel run run parse interpret genmodel run call genmodel run
  • 9. Behind the Scenes : Problems OMG OCL specification has significant issues
      • manual editing => ambiguities, inconsistencies
      • 10. main behaviours obvious
      • 11. corner cases problematic
      • 12. no real consideration of UML @ runtime
        • profiles, merging, serialization, polymorphism
    Eclipse OCL Ecore/UML2 bindings have problems
      • direct extension of Ecore.ecore / UML.ecore
      • 13. accuracy / extensibility
  • 14. Behind the Scenes : Solutions New Eclipse OCL Pivot binding solution
      • pre-compliant OMG prototype
      • 15. concrete syntax 'unchanged'
      • 16. external API similarity
    Shared models
      • Acceleo auto-generation of specification
        • consistent, complete
      • Acceleo/genmodel auto-generation of tooling
        • useable, correct, extensible
    Re-useable for OCL-defined languages => QVT
  • 17. Juno Xtext and Pivot Architecture Develop-time: Java code from Xtext editor Run-time: Fast Java execution Pivot Library Feature Bodies Dispatch Tables Dispatch Runtime Ecore BodyCalls genmodel Acceleo Acceleo Acceleo CSG 2 ASG Editor Parser Xtext Acceleo Acceleo ASG Visitors CSG Visitors Acceleo genmodel genmodel OCLstdlib editor OCLinEcore editor Xtext editor CompleteOCL editor Acceleo genmodel OCL Xtext Console Pivot Runtime
  • 18. OCL evaluation performance Release Compile-time (genmodel) First Run-time Every Run-time Run-time support Helios Text copy OCL parsing Slow Visitor Interpreter Unmodelled library Indigo Text copy OCL parsing Faster Visitor Interpreter Modelled library Faster library Juno OCL parsing Java Body generation Dispatch Table generation Java JIT Fast Inline Polymorphic Dispatcher Modelled library Faster library Polymorphic values
  • 19. OCL and Xbase OCL - executable model-oriented specification language
        • Integer has unlimited range, 4.0 is equal to 4
        • 20. anObject.oclType().name = 'Class'
        • 21. side effect free => analyzable (Impact Analyzer)
      • many small projects
    Xbase - pragmatic Java-like implementation language
        • java.lang.Integer, 4.0 not usually equal to 4
        • 22. anObject.eClass().name == "EClass"
        • 23. side effecting => limited analysis
      • coherent support from itemis
    Both almost useless till embedded in some context
  • 24. OCLinEcore and Xcore
    • Textual Ecore
      • find / replace / search editing
      • 25. full text
    Ecore compliance Operation/Property bodies XMI 100% whatever KM3 80% no Emfatic 95% no Xcore 95% + Xbase + genmodel interpreted Xbase (Juno) Xbase2Java (Juno) OCLinEcore >99% + OCL (+ some UML) interpreted OCL (Helios) OCL2Java (Juno)
  • 26. Summary Eclipse OCL was
    • a Java-based model
    • 27. executed by run-time parsing and interpretation
    Eclipse OCL is (in Helios and Indigo)
    • an integrated editable, interpretable language
    • 28. Xtext OCLinEcore hides the EAnnotation details
    Eclipse OCL will be (Juno M3)
    • executed by genmodelled direct Java code
    • 29. sharing models with OCL specification
  • 30. Obect Control Language
    • OMG specification - OCL 2.x split off from UML 1.x
      • generic UML-independent constraint expressions
      • 31. foundation for many other modelling specifications
      • 32. e.g MOFM2T (Acceleo)
    • direct navigation
    • 33. compact iterations/loops
    • 34. embedded anonymous functions
  • 35. Ecore OCL Architecture Develop-time: EAnnotation from Text editor Run-time: OCL parsed by old LPG tooling Ecore Library CS 2 AS Parser LPG ASG CST genmodel genmodel Sample Ecore editor Text editor OCL Console Ecore Runtime Ecore genmodel CDATA CS actions EMF Delegate EAnnotations EAnnotations + templates
  • 36. Helios Xtext Architecture Develop-time: EAnnotation from Xtext editor Run-time: OCL parsed by old LPG tooling Editor Parser Xtext CSG genmodel OCLstdlib editor OCLinEcore editor Xtext editor CompleteOCL editor Ecore genmodel
  • 37. Indigo Xtext and Pivot Architecture Develop-time: EAnnotation from Xtext editor Run-time: OCL re-parsed by Xtext tooling Pivot Library Ecore CSG 2 ASG Editor Parser Xtext Acceleo Acceleo ASG Visitors CSG Visitors Acceleo genmodel genmodel OCLstdlib editor OCLinEcore editor Xtext editor CompleteOCL editor OCL Xtext Console Pivot Runtime genmodel
  • 38. OCL Resources
    • OCL 2.2 Specification http://www.omg.org/spec/OCL/2.2
        • Clause 7 is quite readable (many typos)
    • The Object Constraint Language: Getting Your Models Ready For MDA Jos B. Warmer, Anneke Kleppe
    • Eclipse MDT/OCL project http://www.eclipse.org/projects/project_summary.php?projectid=modeling.mdt.ocl
  • 39. Project History Pre-Helios IBM contribution Christian Damus Helios OCL delegates Xtext editors OCLinEcore Essential OCL Complete OCL syntactic validation Indigo Pivot model Impact Analyzer Library model Xtext OCL Console re-use in Papyrus re-use in Xtext Accurate evaluation Faster evaluation semantic validation Juno OCL2Java promotion from examples re-use for QVTd Fast evaluation model-defined model validation
  • 40. Essential OCL embedding
    • Interactive Xtext OCL Console
      • supports interactive practice of OCL expressions
      • 41. re-uses Xtext editor
        • eliminates need for intuitive assistant
    • Papyrus Class Diagram Constraint editor
      • embedded Xtext Essential OCL editor
        • pop-up to augment UML model

×