CHAPTER 18

Applying Constraints to the UML Diagrams

images

In This Chapter

  • Defining the Object Constraint Language
  • Defining OCL data types
  • Defining OCL statements
  • Creating invariants, preconditions, and post conditions
  • Navigating association
  • Working with collections, messages, and tuples
  • Applying the OCL Standard Library

images

As I mentioned in earlier chapters, you can use a formal language, the Object Constraint Language (OCL), to specify constraints on attributes and associations, and, in fact, on any classifier.

images There was a previous release of the same document under the title “UML 1.4 with Action Semantics.” To my knowledge, the only difference is the addition of the Action Semantics section. The OMG simply thought that the added content warranted a new version number. You will even find references to 1.4 in the OCL 2.0 specification.

A constraint may be specified as an invariant, a precondition, or a post condition. This description of a constraint reveals one very important fact about OCL: OCL is used to specify static requirements.

images There has been work proposed to integrate a dynamic ...

Get UML™ Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.