CHAPTER 18
Applying Constraints to the UML Diagrams
![]()
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
![]()
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.
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.
There has been work proposed to integrate a dynamic ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access