Modular Embedding of the Object Constraint Language into a Programming Language

  • Fabian Büttner
  • Martin Gogolla
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7021)


The Object Constraint Language (OCL) is a well-accepted ingredient in model-driven engineering and accompanying modeling languages like UML (Unified Modeling Language) or EMF (Eclipse Modeling Framework) which support object-oriented software development. Among various possibilities, OCL offers the formulation of state invariants and operation contracts in form of pre- and postconditions. With OCL, side effect free query operations can be implemented. However, for operations changing the system state an implementation cannot be given within OCL. In order to fill this gap, this paper proposes the language SOIL (Simple OCL-like Imperative Language). The expression sub-language of SOIL is identical to OCL. SOIL adds well-known, traditional imperative constructs. Thus by employing OCL and SOIL, it is possible to describe any operation in a declarative way and in an operational way on the modeling level without going into the details of a conventional programming language. In contrast to other similar approaches, the embedding of OCL into SOIL is done in a new, careful way so that elementary properties in OCL are preserved (for example, commutativity of logical conjunction). The paper discusses the major criteria of a conservative embedding of OCL into SOIL. SOIL has a sound formal semantics and is implemented in the UML and OCL tool USE (UML-based Specification Environment).


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Akehurst, D., Patrascoiu, O.: KMF (Kent Modeling Framework) OCL Library. website (2011), (last visited February 10, 2011)
  2. 2.
    Brucker, A.D., Wolff, B.: HOL-OCL: A Formal Proof Environment for UML/OCL. In: Fiadeiro, J.L., Inverardi, P. (eds.) FASE 2008. LNCS, vol. 4961, pp. 97–100. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  3. 3.
    Büttner, F.: Reusing OCL in the Definition of Imperative Languages. PhD thesis, Universität Bremen, Fachbereich Mathematik und Informatik, Logos Verlag, Berlin (2011)Google Scholar
  4. 4.
    Büttner, F.: Transformation-Based Structure Model Evolution. In: Bruel, J.-M. (ed.) MoDELS 2005. LNCS, vol. 3844, pp. 339–340. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  5. 5.
    Büttner, F., Kuhlmann, M.: Shortcomings of the Embedding of OCL into QVT ImperativeOCL. In: Chaudron, M.R.V. (ed.) MODELS 2008. LNCS, vol. 5421, pp. 263–272. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  6. 6.
    Cabot, J., Teniente, E.: Transformation techniques for OCL constraints. Science of Computer Programming 68(3), 179–195 (2007)CrossRefzbMATHGoogle Scholar
  7. 7.
    Chiorean, D., Pasca, M., Cârcu, A., Botiza, C., Moldovan, S.: Ensuring UML Models Consistency Using the OCL Environment. Electronic Notes in Theorethical Computer Science 102, 99–110 (2004)CrossRefGoogle Scholar
  8. 8.
    Clark, A., Warmer, J. (eds.): Object Modeling with the OCL: The Rationale behind the Object Constraint Language. LNCS, vol. 2263, pp. 4–20. Springer, Heidelberg (2002)CrossRefzbMATHGoogle Scholar
  9. 9.
    Cuadrado, J.S., Jouault, F., Molina, J.G., Bézivin, J.: Deriving OCL Optimization Patterns from Benchmarks. ECEASST 15 (2008)Google Scholar
  10. 10.
    Distefano, D.S., Katoen, J.P., Rensink, A.: Towards model checking OCL. In: ECOOP 2000: Defining Precise Semantics for UML, Sophia Antipolis, France (June 2000)Google Scholar
  11. 11.
    Gogolla, M., Büttner, F., Richters, M.: USE: A UML-Based Specification Environment for Validating UML and OCL. Science of Computer Programming 69, 27–34 (2007)CrossRefzbMATHGoogle Scholar
  12. 12.
    Hudak, P.: Modular Domain Specific Languages and Tools. In: Proceedings of the Fifth International Conference on Software Reuse, pp. 134–142. IEEE Computer Society Press, Los Alamitos (1998)Google Scholar
  13. 13.
    Hußmann, H., Demuth, B., Finger, F.: Modular architecture for a toolset supporting OCL. Science of Computer Programming 44(1), 51–69 (2002)CrossRefzbMATHGoogle Scholar
  14. 14.
    Jiang, K., Zhang, L., Miyake, S.: Using OCL in Executable UML. ECEASST 9 (2008)Google Scholar
  15. 15.
    Jouault, F., Allilaire, F., Bézivin, J., Kurtev, I.: ATL: A model transformation tool. Science of Computer Programming 72(1-2), 31–39 (2008)CrossRefzbMATHGoogle Scholar
  16. 16.
    Klasse Objecten. The Klasse Objecten OCL Checker Octopus. website,, Klasse Objecten (2005)
  17. 17.
    Kolovos, D.S., Paige, R.F., Polack, F.: The Epsilon Object Language (EOL). In: Rensink, A., Warmer, J. (eds.) ECMDA-FA 2006. LNCS, vol. 4066, pp. 128–142. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  18. 18.
    Krahn, H., Rumpe, B., Völkel, S.: MontiCore: Modular Development of Textual Domain Specific Languages. In: Paige, R.F., Meyer, B. (eds.) TOOLS (46). LNBIP, vol. 11, pp. 297–315. Springer, Heidelberg (2008)Google Scholar
  19. 19.
    Krieger, M.P., Knapp, A.: Executing Underspecified OCL Operation Contracts with a SAT Solver. ECEASST 15 (2008)Google Scholar
  20. 20.
    Markovic, S., Baar, T.: Refactoring OCL annotated UML class diagrams. Software and System Modeling 7(1), 25–47 (2008)CrossRefGoogle Scholar
  21. 21.
    Eclipse model development tools (MDT) project page. Website, (last visited February 10, 2011)
  22. 22.
    Mellor, S.J.: Executable UML: A Foundation for Model-Driven Architecture. Addison-Wesley (2002)Google Scholar
  23. 23.
    Mellor, S.J., Scott, K., Uhl, A., Weise, D.: MDA Distilled: Principles of Model-Driven Architecture. Addison-Wesley, Boston (2004)Google Scholar
  24. 24.
    Meyer, B.: Eiffel: The Language. Prentice-Hall, Englewood Cliffs (1992)zbMATHGoogle Scholar
  25. 25.
    Siikarla, J.P.M., Selonen, P.: Combining OCL and Programming Languages for UML Model Processing. In: Schmitt, P.H. (ed.) Proceedings of the Workshop, OCL 2.0 – Industry Standard or Scientific Playground, vol. 102. Elsevier (2004)Google Scholar
  26. 26.
    OMG. MDA Guide Version 1.0.1. Object Management Group, Inc., Framingham, Mass, Internet (June 2003),
  27. 27.
    OMG. Object Constraint Language Specification, version 2.0 (Document formal/2006-05-01) (June 2006)Google Scholar
  28. 28.
    OMG. Meta Object Facility (MOF) 2.0 Query/Views/Transformation Specification (Document formal/08-04-03). Object Management Group, Inc., Framingham, Mass, Internet (2008),
  29. 29.
    Richters, M.: A Precise Approach to Validating UML Models and OCL Constraints. PhD thesis, Universität Bremen, Fachbereich Mathematik und Informatik, Logos Verlag, Berlin, BISS Monographs, No. 14 (2002)Google Scholar
  30. 30.
    RoclET-Team. Welcome to RoclET. Website, (last visited February 10, 2011)
  31. 31.
    Warmer, J., Kleppe, A.: The Object Constraint Language: Getting Your Models Ready for MDA. Object Technology Series. Addison-Wesley, Reading (2003)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Fabian Büttner
    • 1
  • Martin Gogolla
    • 1
  1. 1.Computer Science Department, Database Systems GroupUniversity of BremenGermany

Personalised recommendations