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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Abramsky, S., Jung, A.: Domain Theory. In: Handbook of Logic in Computer Science, vol. 3, pp. 1–168. Clarendon Press (1994)
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)
Brambilla, M., Cabot, J., Wimmer, M.: Model-driven Software Engineering in Practice. Morgan and Claypool Publishers (2012)
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)
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)
Chang, C., Keisler J.: Model Theory. North-Holland, rev. edn. (1990)
Darvans, Á., Müller, P.: Reasonong about Method Calls in JML. In: Formal Techniques for Java-Like Programms, FTfJLP 2005 (2005)
Harel, D.: Statecharts: a visual formalism for complex systems. Sci. Comput. Program. 8, 231–274 (1987)
Hennicker, R., Knapp, A., Baumeister, H.: Semantics of OCL operation specifications. ENTCS 102(2), 111–132 (2004)
Hennicker, R., Baumeister, H., Knapp, Al., Wirsing, M.: Specifying component invariants with OCL. GI Jahrestagung 2001, pp. 600–607 (2001)
Kiczales, G., et al.: An overview of AspectJ. LNCS, vol. 2072, pp. 327–355. Springer (2001)
Kosiuczenko, P.: Specification of invariability in OCL. In: Nierstrasz, O., et al. (eds.) MoDELS 2006. LNCS, vol. 4199, pp. 676–691. Springer (2006)
Kosiuczenko, P.: 17. Specification of Invariability in OCL. J. Softw. Syst. Model. 12(2), 415–434 (2013)
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)
Mitchell, R., McKim, J.: Design by contract by example. Addison-Wesley (2001)
Meyer, B.: Object-Oriented Software Construction. Prentice Hall, NJ (1998)
Naumann, D.: Observational purity and encapsulation. In: Cerioli, M., (ed.) Fundamantal Aspects of Software Engineering (FASE 2005). LNCS, vol. 3442, pp. 190–204 (2005)
Naumann, D.: Observational purity and encapsulation. Theor. Comput. Sci. 376(3), 205–224 (2007)
OMG, MDA Guide, Version 1.0.1, June 2003
OMG, OCL Specification, Version 2.4, February 2014
OMG, Unified Modeling Language Specification: Superstructure, Version 2.1.1, 05 February 2007 (2007)
OMG, Unified Modeling Language Specification: Superstructure, 2.5.1, December 2017
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)
Rumpe, B.: Agile Modeling with UML - Code Generation, Testing, Refactoring. Springer (2017)
Warmer, J., Kleppe, A.: Object constraint language: getting your models ready for MDA. Addison Wesley (2003)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer Nature Switzerland AG
About this paper
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
DOI: https://doi.org/10.1007/978-3-319-99617-2_4
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-99616-5
Online ISBN: 978-3-319-99617-2
eBook Packages: Intelligent Technologies and RoboticsIntelligent Technologies and Robotics (R0)