Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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.

Filter by
Sorted by
Tagged with
2 votes
0 answers

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 ...
João Otero's user avatar
1 vote
1 answer

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 ...
Fuhrmanator's user avatar
  • 1,435
1 vote
0 answers

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 ...
Robbo's user avatar
  • 167
1 vote
0 answers

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 ...
Robbo's user avatar
  • 167
10 votes
1 answer

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 ...
Aimee Jones's user avatar