O'Reilly logo

Object Constraint Language, The: Getting Your Models Ready for MDA, Second Edition by Anneke Kleppe, Jos Warmer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Basic OCL Elements

This chapter describes the basic elements with which you can write constraints. These basic elements can be used without any reference to the elements in the UML model.

Expressions, Types, and Values

In OCL, each value, whether it is an object, a component instance, or a datavalue, has a certain type, which defines the operations that can be applied to the object. Types in OCL are divided into the following groups:

  • Predefined types, as defined in the standard library, including the following:

    • Basic types

    • Collection types

  • User-defined types

The predefined basic types are Integer, Real, String, and Boolean, which are described in this chapter in some detail. Their definitions are similar to those in many known languages.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required