Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [ocl]

The Object Constraint Language (OCL) is a declarative language describing rules applying to Unified Modeling Language (UML) models developed at IBM and is now part of the UML standard.

1
vote
0answers
27 views

OCL - how to explicitly model if a property can or can not be null?

I'm thinking about defensive programming here, through model driven design. I would insert null guards where a property must not be null, but would use a Maybe struct in the cases where it's ...
1
vote
1answer
153 views

OCL in a domain model to capture rules for building houses and hotels in Monopoly

It's maybe an old horse to beat (not dead yet?), but I'm wondering if OCL allows modeling the problem of the business rules for building houses and hotels in the game of Monopoly within a domain model ...
1
vote
0answers
217 views

How to use derive: in OCL when the type is not primitive

Let's consider the following class diagram I would like to express the following rule in OCL if cond = true then bderived = b else bderived.x = b.x + 10 bderived.y = b.y + 10 endif My best ...
1
vote
0answers
243 views

How to specify OCL time constraints?

The article An OCL Extension for Real-Time Constraints describes and interesting extension to OCL for the specification of time constraints. New types OclConfiguration and OclPath are defined along ...
10
votes
1answer
645 views

Object Constraint Language (OCL) for Stack in java.util package

I have an exam coming up and I'm looking at past papers to get some ideas of what to expect. I'm a bit stuck on the following one and would really appreciate if someone could give some example ...