Skip to main content

OCL: Syntax, Semantics, and Tools

  • Chapter
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2263))

Abstract

The Object Constraint Language OCL allows to formally specify constraints on a UML model. We present a formal syntax and semantics for OCL based on set theory including expressions, invariants and pre- and postconditions. A formal foundation for OCL makes the meaning of constraints precise and helps to eliminate ambiguities and inconsistencies. A precise language definition is also a prerequisite for implementing Case tools providing enhanced support for UML models and OCL constraints. We give a survey of some OCL tools and discuss one of the tools in some more detail. The design and implementation of the USE tool supporting the validation of UML models and OCL constraints is based on the formal approach presented in this paper.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. T. Baar and R. Hähnle. An integrated metamodel for OCL types. In R. France, B. Rumpe, J.-M. Bruel, A. Moreira, J. Whittle, and I. Ober, editors, Proc. OOPSLA 2000, Workshop Refactoring the UML: In Search of the Core, Minneapolis, Minnesota, USA, 2000., 2000.

    Google Scholar 

  2. T. Baar, R. Hähnle, T. Sattler, and P. H. Schmitt. Entwurfsmustergesteuerte Erzeugung von OCL-Constraints. In K. Mehlhorn and G. Snelting, editors, Informatik 2000, 30. Jahrestagung der Gesellschaft für Informatik, pages 389–404, Sept. 2000.

    Google Scholar 

  3. G. Booch, J. Rumbaugh, and I. Jacobson. The Unified Modeling Language User Guide. Addison-Wesley, 1998.

    Google Scholar 

  4. P. Bottoni, M. Koch, F. Parisi-Presicce, and G. Taentzer. Consistency checking and visualization of OCL constraints. In A. Evans, S. Kent, and B. Selic, editors, UML 2000-The Unified Modeling Language. Advancing the Standard. Third International Conference, York, UK, October 2000, Proceedings, volume 1939 of LNCS, pages 294–308. Springer, 2000.

    Google Scholar 

  5. T. Clark. Type checking UML static diagrams. In R. France and B. Rumpe, editors, UML’99-The Unified Modeling Language. Beyond the Standard. Second International Conference, Fort Collins, itCO, USA, October 28–30. 1999, Proceedings, volume 1723 of LNCS, pages 503–517. Springer, 1999.

    Google Scholar 

  6. S. Cook, A. Kleppe, R. Mitchell, B. Rumpe, J. Warmer, and A. Wills. The Amsterdam manifesto on OCL. Technical Report TUM-I9925, Technische Universität München, Dec. 1999.

    Google Scholar 

  7. S. Cook, A. Kleppe, R. Mitchell, J. Warmer, and A. Wills. Defining the context of OCL expressions. In R. France and B. Rumpe, editors, UML’99-The Unified Modeling Language. Beyond the Standard. Second International Conference, Fort Collins, CO, USA, October 28–30. 1999, Proceedings, volume 1723 of LNCS, pages 372–383. Springer, 1999.

    Google Scholar 

  8. D. Distefano, J.-P. Katoen, and A. Rensink. On a temporal logic for object-based systems. In S. F. Smith and C. L. Talcott, editors, Formal Methods for Open Object-Based Distributed Systems IV-Proc. FMOODS’2000, September, 2000, Stanford, California, USA. Kluwer Academic Publishers, 2000.

    Google Scholar 

  9. F. Finger. Design and implementation of a modular OCL compiler. Diplomarbeit, Dresden University of Technology, Department of Computer Science, Software Engineering Group, Germany, Mar. 2000.

    Google Scholar 

  10. M. Gogolla and M. Richters. On constraints and queries in UML. In M. Schader and A. Korthaus, editors, The Unified Modeling Language-Technical Aspects and Applications, pages 109–121. Physica-Verlag, Heidelberg, 1998.

    Google Scholar 

  11. A. Hamie, F. Civello, J. Howse, S. Kent, and R. Mitchell. Reflections on the Object Constraint Language. In J. Bézivin and P.-A. Muller, editors, The Unified Modeling Language, UML’98-Beyond the Notation. First International Workshop, Mulhouse, France, June 1998, pages 137–145, 1998.

    Google Scholar 

  12. C. A. R. Hoare. An Axiomatic Basis of Computer Programming. Communications of the ACM, 12:576–580, 1969.

    Article  MATH  Google Scholar 

  13. H. Hussmann, B. Demuth, and F. Finger. Modular architecture for a toolset supporting OCL. In A. Evans, S. Kent, and B. Selic, editors, UML 2000-The Unified Modeling Language. Advancing the Standard. Third International Conference, York, UK, October 2000, Proceedings, volume 1939 of LNCS, pages 278–293. Springer, 2000.

    Google Scholar 

  14. A. Kleppe and J. Warmer. Extending OCL to include actions. In A. Evans, S. Kent, and B. Selic, editors, UML 2000-The Unified Modeling Language. Advancing the Standard. Third International Conference, York, UK, October 2000, Proceedings, volume 1939 of LNCS, pages 440–450. Springer, 2000.

    Google Scholar 

  15. L. Mandel and M. V. Cengarle. On the expressive power of OCL. In FM’99-Formal Methods. World Congress on Formal Methods in the Development of Computing Systems, Toulouse, France, September 1999. Proceedings, Volume I, volume 1708 of LNCS, pages 854–874. Springer, 1999.

    Chapter  Google Scholar 

  16. B. Meyer. Object-Oriented Software Construction. Prentice Hall, second edition, 1997.

    Google Scholar 

  17. OMG. Object Constraint Language Specification. In OMG Unified Modeling Language Specification, Version 1.3, June 1999 [19], chapter 7.

    Google Scholar 

  18. OMG, editor. OMG Unified Modeling Language Specification, Version 1.3, June 1999. Object Management Group, Inc., Framingham, Mass., Internet: http://www.omg.org, 1999.

  19. S. Ramakrishnan and J. McGregor. Extending OCL to support temporal operators. In Proceedings of the 21st InternationalConfer ence on Software Engineering (ICSE99) Workshop on Testing Distributed Component-Based Systems, LA, May 16–22, 1999, 1999.

    Google Scholar 

  20. M. Richters. The USE tool: A UML-based specification environment, 2001. http://www.db.informatik.uni-bremen.de/projects/USE/.

  21. M. Richters and M. Gogolla. On formalizing the UML Object Constraint Language OCL. In T. W. Ling, S. Ram, and M. L. Lee, editors, Proc. 17th Int. Conf. ConceptualMo deling (ER’98), volume 1507 of LNCS, pages 449–464. Springer, 1998.

    Google Scholar 

  22. M. Richters and M. Gogolla. A metamodel for OCL. In R. France and B. Rumpe, editors, UML’99-The Unified Modeling Language. Beyond the Standard. Second International Conference, Fort Collins, CO, USA, October 28–30. 1999, Proceedings, volume 1723 of LNCS, pages 156–171. Springer, 1999.

    Google Scholar 

  23. M. Richters and M. Gogolla. Validating UML models and OCL constraints. In A. Evans, S. Kent, and B. Selic, editors, UML 2000-The Unified Modeling Language. Advancing the Standard. Third International Conference, York, UK, October 2000, Proceedings, volume 1939 of LNCS, pages 265–277. Springer, 2000.

    Google Scholar 

  24. J. Robbins et al. Argo/UML CASE tool, 2001. http://www.argouml.org.

  25. J. Rumbaugh, I. Jacobson, and G. Booch. The Unified Modeling Language Reference Manual. Addison-Wesley, 1998.

    Google Scholar 

  26. S. Sendall and A. Strohmeier. From use cases to system operation specifications. In A. Evans, S. Kent, and B. Selic, editors, UML 2000-The Unified Modeling Language. Advancing the Standard. Third International Conference, York, UK, October 2000, Proceedings, volume 1939 of LNCS, pages 1–15. Springer, 2000.

    Google Scholar 

  27. J. Warmer and A. Kleppe. The Object Constraint Language: Precise Modeling with UML. Addison-Wesley, 1998.

    Google Scholar 

  28. M. Wittmann. Ein Interpreter für OCL. Master’s thesis, Ludwig-Maximilians-Universität München, 2000.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2002 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Richters, M., Gogolla, M. (2002). OCL: Syntax, Semantics, and Tools. In: Clark, T., Warmer, J. (eds) Object Modeling with the OCL. Lecture Notes in Computer Science, vol 2263. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45669-4_4

Download citation

  • DOI: https://doi.org/10.1007/3-540-45669-4_4

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-43169-5

  • Online ISBN: 978-3-540-45669-8

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics