Object Constraint Language (OCL Sample Clauses

Object Constraint Language (OCL. A diagram is an efficient way of conveying meaning. However, there are many nuances of meaning such as uniqueness, limits, constraints and so on, which a diagram cannot easily convey. A wholly graphical means of constructing a precise and unambiguous description of a model is simply not viable. The Object Constraint Language (OCL) [102, 139]—which has moved on from being just a constraint language since its inception—is a fully fledged object expression language, specifically designed to support the construction of precise UML models. It is not a stand-alone language, though, because OCL expressions cannot reside outside the context of a UML model. The power of OCL is roughly equivalent to that of first-order predicate logic. Example 8. (OCL) If A is related to B via R1 as in Figure 3.4, the following OCL A R1 /¸ B B1 : Nat expression evaluates to true, if for all objects of B linked to self (an object of A) via R1, the value of attribute B1 exceeds 0. context: A inv: self.R_1->forAll(B_1() > 0)