UML&OCL Modeling Languages


Summary

Not all the part of a software can be graphically represented and some aspects have to be textually specified in an unambigous language: OCL.

This one uses sets (formally "classes") and first-order logic expressions (in an object-oriented notation).

9. OCL fundamentals

a. Get set of instances

Class.instances

b. Sets' operations

set->size()
set->union(set2)
set->includes(element)

b. General invariant

set.forall( e | p(e) )

c. Filtering elements

set.select( e | p(e) )

d. Projecting property

set.collect( e | e.attribute )

10 - 10