Skip to main content

Automatic Translation of OCL Meta-Level Constraints into Java Meta-Programs

  • Conference paper
  • First Online:
Software Engineering, Artificial Intelligence, Networking and Parallel/Distributed Computing 2015

Part of the book series: Studies in Computational Intelligence ((SCI,volume 612))

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.

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 84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 109.99
Price excludes VAT (USA)
  • Durable hardcover 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

Notes

  1. 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. 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

  1. Eclipse ocl. http://www.eclipse.org/modeling/mdt/?project=ocl

  2. Kermeta. http://www.kermeta.org

  3. Acceleo: Implementation of MOF to text language. http://www.omg.org/news/meetings/tc/mn/specialevents/ecl/Juliot-Acceleo.pdf

  4. Bass, L., Clements, P., Kazman, R.: Software architecture in practice. Addison-Wesley, Boston (2012)

    Google Scholar 

  5. BCEL: The byte code engineering library. http://commons.apache.org/proper/commons-bcel/

  6. Briand, L.C., Dzidek, W., Labiche, Y.: Using aspect-oriented programming to instrument OCL contracts in Java. Technical Report, Carlton University, Canada (2004)

    Google Scholar 

  7. 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)

    Google Scholar 

  8. 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)

    Google Scholar 

  9. Erl, T.: SOA Design Patterns. Pearson Education, London (2008)

    Google Scholar 

  10. 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)

    Google Scholar 

  11. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design patterns: Elements of Reusable Object-Oriented Software. Addison Wesley (1994)

    Google Scholar 

  12. 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)

    Google Scholar 

  13. 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)

    Google Scholar 

  14. Hussmann, H., Demuth, B., Finger, F.: Modular architecture for a toolset supporting OCL. In: ł UML2000The Unified Modeling Language, pp. 278–293. Springer, Berlin (2000)

    Google Scholar 

  15. JDT: Java development tools. http://www.eclipse.org/jdt/

  16. Jouault, F., Kurtev, I.: Transforming models with ATL. In: Satellite Events at the MoDELS 2005 Conference, pp. 128–138. Springer, Berlin (2006)

    Google Scholar 

  17. LCI: Object constraint language environnement. http://lci.cs.ubbcluj.ro/ocle/

  18. Octopus: OCL tool for precise UML specifications. http://octopus.sourceforge.net

  19. OMG: Object constraint language, version 2.3.1, document formal/2012-01-01. http://www.omg.org/spec/OCL/2.3.1/PDF/

  20. Petre, M.: UML in practice. In: Proceedings of the 35th International Conference on Software Engineering (ICSE 2013), pp. 722–731. IEEE Press (2013)

    Google Scholar 

  21. Reenskaug, T.: Thing-model-view editor an example from a planning system, xerox parc technical note (1979)

    Google Scholar 

  22. Shaw, M., Garlan, D.: Software Architecture: Perspectives on an Emerging Discipline. Prentice Hall, Upper Saddle River (1996)

    MATH  Google Scholar 

  23. Tibermacine, C.: Software Architecture 2. Software Architecture: Architecture Constraints. Wiley, New York (2014)

    Google Scholar 

  24. 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)

    Google Scholar 

  25. Zdun, U., Avgeriou, P.: A catalog of architectural primitives for modeling architectural patterns. Inf. Softw. Technol. 50(9), 1003–1034 (2008)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Sahar Kallel .

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics