Skip to main content

On the Functional Specification of Queries in OCL

  • Conference paper
  • First Online:
Engineering Software Systems: Research and Praxis (KKIO 2018)

Part of the book series: Advances in Intelligent Systems and Computing ((AISC,volume 830))

Included in the following conference series:

  • 373 Accesses

Abstract

Query operations are used to evaluate constraints such as invariants, pre- and post-conditions. The UML standard requires that a query is pure; i.e. it must not change the global system state. However, operations used for checking validity of conditions quite often have side effects. As a result, the global system state changes, the problem is that the validity of constraints should not be changed. Purity is a subject of intensive research; unfortunately this notion was not properly investigated in the case of OCL. This paper investigates how the very restrictive notion of purity can be relaxed in order to be applicable in the case of state changing operations. It is shown how to define queries in functional terms relatively to views. Relative queries are classified into rigid- and non-rigid ones. It is shown that non-rigid queries preserve pre- and post-conditions; whereas rigid queries preserve also invariants.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 129.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 169.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

Institutional subscriptions

References

  1. Abramsky, S., Jung, A.: Domain Theory. In: Handbook of Logic in Computer Science, vol. 3, pp. 1–168. Clarendon Press (1994)

    Google Scholar 

  2. Barnett, M., Naumann, D., A., Schulte, W., Sun, Q.: Allowing state changes in specifications. In: International Conference on Emerging Trends in Information and Communication Security, ETRICS. LNCS, vol. 3995, pp. 321–336. Springer (2006)

    Google Scholar 

  3. Brambilla, M., Cabot, J., Wimmer, M.: Model-driven Software Engineering in Practice. Morgan and Claypool Publishers (2012)

    Google Scholar 

  4. Cabot, J. Gogolla, M.: Object constraint language (OCL): a definitive guide. In: Formal Methods for Model-Driven Engineering, SFM 2012, Bertinoro, Italy, 18-23 June 2012. LNCS, Vol. 7320, pp. 58–90. Springer (2012)

    Google Scholar 

  5. Cengarle, M., Knapp, A.: OCL 1.4/1.5 vs. OCL 2.0 expressions: formal semantics and expressiveness. Softw. Syst. Model. 3(1), 9–30 (2004)

    Article  Google Scholar 

  6. Chang, C., Keisler J.: Model Theory. North-Holland, rev. edn. (1990)

    Google Scholar 

  7. Darvans, Á., Müller, P.: Reasonong about Method Calls in JML. In: Formal Techniques for Java-Like Programms, FTfJLP 2005 (2005)

    Google Scholar 

  8. Harel, D.: Statecharts: a visual formalism for complex systems. Sci. Comput. Program. 8, 231–274 (1987)

    Article  MathSciNet  Google Scholar 

  9. Hennicker, R., Knapp, A., Baumeister, H.: Semantics of OCL operation specifications. ENTCS 102(2), 111–132 (2004)

    Google Scholar 

  10. Hennicker, R., Baumeister, H., Knapp, Al., Wirsing, M.: Specifying component invariants with OCL. GI Jahrestagung 2001, pp. 600–607 (2001)

    Google Scholar 

  11. Kiczales, G., et al.: An overview of AspectJ. LNCS, vol. 2072, pp. 327–355. Springer (2001)

    Google Scholar 

  12. Kosiuczenko, P.: Specification of invariability in OCL. In: Nierstrasz, O., et al. (eds.) MoDELS 2006. LNCS, vol. 4199, pp. 676–691. Springer (2006)

    Google Scholar 

  13. Kosiuczenko, P.: 17. Specification of Invariability in OCL. J. Softw. Syst. Model. 12(2), 415–434 (2013)

    Google Scholar 

  14. Leavens, G., Yoonsik, C., Clifton, C., Ruby, C., Cok, D.: How the design of JML accomodates both runtime assertion checking and formal verification. Sci. Comput. Program. 55(1–3), 185–208 (2005)

    Article  Google Scholar 

  15. Mitchell, R., McKim, J.: Design by contract by example. Addison-Wesley (2001)

    Google Scholar 

  16. Meyer, B.: Object-Oriented Software Construction. Prentice Hall, NJ (1998)

    Google Scholar 

  17. Naumann, D.: Observational purity and encapsulation. In: Cerioli, M., (ed.) Fundamantal Aspects of Software Engineering (FASE 2005). LNCS, vol. 3442, pp. 190–204 (2005)

    Google Scholar 

  18. Naumann, D.: Observational purity and encapsulation. Theor. Comput. Sci. 376(3), 205–224 (2007)

    Article  MathSciNet  Google Scholar 

  19. OMG, MDA Guide, Version 1.0.1, June 2003

    Google Scholar 

  20. OMG, OCL Specification, Version 2.4, February 2014

    Google Scholar 

  21. OMG, Unified Modeling Language Specification: Superstructure, Version 2.1.1, 05 February 2007 (2007)

    Google Scholar 

  22. OMG, Unified Modeling Language Specification: Superstructure, 2.5.1, December 2017

    Google Scholar 

  23. Pnueli, A., Shalev, M.: What is in a step: on the semantics of Statecharts. In: Meyer, R., Ito, T. (eds.) TACS 1991. LNCS, vol. 526, pp. 244–264. Springer, New York (1991)

    Google Scholar 

  24. Rumpe, B.: Agile Modeling with UML - Code Generation, Testing, Refactoring. Springer (2017)

    Google Scholar 

  25. Warmer, J., Kleppe, A.: Object constraint language: getting your models ready for MDA. Addison Wesley (2003)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Piotr Kosiuczenko .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Kosiuczenko, P. (2019). On the Functional Specification of Queries in OCL. In: Kosiuczenko, P., Zieliński, Z. (eds) Engineering Software Systems: Research and Praxis. KKIO 2018. Advances in Intelligent Systems and Computing, vol 830. Springer, Cham. https://doi.org/10.1007/978-3-319-99617-2_4

Download citation

Publish with us

Policies and ethics