Some Shortcomings of OCL, the Object Constraint Language of UML
Mandana Vaziri, Daniel Jackson · 2000
this paper is to expose some shortcomings of the Object Constraint Language (OCL). We argue that, despite its numerous benefits, OCL is too implementation-oriented and therefore not well-suited for conceptual modelling. Moreover, it is at times unnecessarily verbose, yet far from natural language. In the past couple of years, we have designed a language, Alloy, that has similar motivations to OCL, while attempting to avoid some of these drawbacks. To illustrate the weaknesses of OCL, and some ways in which it may be improved, we have translated most of the core package of the UML metamodel, together with its well-formedness constraints, into Alloy. Moreover, we have shown that this subset of the UML metamodel is consistent, provided that this translation is valid, using Alloy's analysis tool, Alcoa. Section 2 describes the requirements of OCL and its shortcomings with respect to these requirements. Section 3 gives an overview of Alloy. Section 4 presents the translation of the UML metamodel into Alloy, and illustrates the issues raised in Section 2. Finally, Appendix A contains the complete translation of the metamodel classes into Alloy, and Appendix B the translation of the metamodel constraints. 2 Shortcomings of OCL