Abstract
In order to make explicit and tangible their design choices , software developers integrate, in their applications’ models, constraints that their models and their implementations should satisfy. Various environments enable constraint checking during the modeling stage, but in most cases they do not generate code that would enable the checking of these constraints during the implementation stage. It turns out that this is possible in a number of cases. Environments that provide this functionality only offer it for functional constraints (related to the states of objects in applications) and not for architectural ones (related to the structure of applications). Considering this limitation, we describe in this paper a system that generates metaprograms starting from architecture constraints, written in OCL at the metamodel level, and associated to a specific UML model of an application. These metaprograms enable the checking of these constraints at runtime.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
We assume in this paper that the reader is familiar with UML and Java languages. This is the reason why the two metamodels are not detailed. They are depicted only for accompanying OCL constraints in order to see how navigations in the metamodels are established.
- 2.
We use getDeclaredField() instead of getFields() to retrieve all attributes (private and public). For those we inherit, we must specify them in the OCL constraint using the role superClass.
References
Eclipse ocl. http://www.eclipse.org/modeling/mdt/?project=ocl
Kermeta. http://www.kermeta.org
Acceleo: Implementation of MOF to text language. http://www.omg.org/news/meetings/tc/mn/specialevents/ecl/Juliot-Acceleo.pdf
Bass, L., Clements, P., Kazman, R.: Software architecture in practice. Addison-Wesley, Boston (2012)
BCEL: The byte code engineering library. http://commons.apache.org/proper/commons-bcel/
Briand, L.C., Dzidek, W., Labiche, Y.: Using aspect-oriented programming to instrument OCL contracts in Java. Technical Report, Carlton University, Canada (2004)
Cabot, J., Clarisó, R., Riera, D.: Umltocsp: a tool for the formal verification of UML/OCL models using constraint programming. In: Proceedings of the 22nd IEEE/ACM International Conference on Automated Software Engineering, pp. 547–548. ACM (2007)
Demuth, B.: The dresden OCL toolkit and its role in information systems development. In: Proceedings of the 13th International Conference on Information Systems Development (ISD2004) (2004)
Erl, T.: SOA Design Patterns. Pearson Education, London (2008)
Ferdjoukh, A., Baert, A.E., Chateau, A., Coletta, R., Nebut, C.: A CSP approach for metamodel instantiation. In: IEEE Internationnal Conference on Tools with Artificial Intelligence, ICTAI 2013, pp. 1044–1051 (2013)
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design patterns: Elements of Reusable Object-Oriented Software. Addison Wesley (1994)
Hamie, A.: Pattern-based mapping of OCL specifications to JML contracts. In: 2014 2nd International Conference on Model-Driven Engineering and Software Development (MODELSWARD), pp. 193–200. IEEE (2014)
Hassam, K., Sadou, S., Fleurquin, R., et al.: Adapting OCL constraints after a refactoring of their model using an MDE process. In: Belgian-Netherlands software Evolution seminar (BENEVOL 2010), pp. 16–27 (2010)
Hussmann, H., Demuth, B., Finger, F.: Modular architecture for a toolset supporting OCL. In: ł UML2000The Unified Modeling Language, pp. 278–293. Springer, Berlin (2000)
JDT: Java development tools. http://www.eclipse.org/jdt/
Jouault, F., Kurtev, I.: Transforming models with ATL. In: Satellite Events at the MoDELS 2005 Conference, pp. 128–138. Springer, Berlin (2006)
LCI: Object constraint language environnement. http://lci.cs.ubbcluj.ro/ocle/
Octopus: OCL tool for precise UML specifications. http://octopus.sourceforge.net
OMG: Object constraint language, version 2.3.1, document formal/2012-01-01. http://www.omg.org/spec/OCL/2.3.1/PDF/
Petre, M.: UML in practice. In: Proceedings of the 35th International Conference on Software Engineering (ICSE 2013), pp. 722–731. IEEE Press (2013)
Reenskaug, T.: Thing-model-view editor an example from a planning system, xerox parc technical note (1979)
Shaw, M., Garlan, D.: Software Architecture: Perspectives on an Emerging Discipline. Prentice Hall, Upper Saddle River (1996)
Tibermacine, C.: Software Architecture 2. Software Architecture: Architecture Constraints. Wiley, New York (2014)
Tibermacine, C., Fleurquin, R., Sadou, S.: On-demand quality-oriented assistance in component-based software evolution. In: Proceedings of the 9th ACM SIGSOFT International Symposium on Component-Based Software Engineering (CBSE’06), pp. 294–309. Springer LNCS, Vasteras, Sweden (2006)
Zdun, U., Avgeriou, P.: A catalog of architectural primitives for modeling architectural patterns. Inf. Softw. Technol. 50(9), 1003–1034 (2008)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer International Publishing Switzerland
About this paper
Cite this paper
Kallel, S., Tibermacine, C., Tramoni, B., Dony, C., Kacem, A.H. (2016). Automatic Translation of OCL Meta-Level Constraints into Java Meta-Programs. In: Lee, R. (eds) Software Engineering, Artificial Intelligence, Networking and Parallel/Distributed Computing 2015. Studies in Computational Intelligence, vol 612. Springer, Cham. https://doi.org/10.1007/978-3-319-23509-7_15
Download citation
DOI: https://doi.org/10.1007/978-3-319-23509-7_15
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-23508-0
Online ISBN: 978-3-319-23509-7
eBook Packages: EngineeringEngineering (R0)