Specify Constraint for Parameter of a UML Operation [message #1798041] |
Sun, 11 November 2018 11:52  |
Eclipse User |
|
|
|
Hi,
I have a UML model and I would like to specify some constraints using OCL. Specifying invariants for classes works fine, but now I need to define a constraint on the parameter of an operation.
For example, let's suppose I have a class BankAccount with an operation executeTransfer(transfer: TransferDetails). A TransferDetails object contains the amount of money to be transferred and the destination of the transfer. How do I specify, e.g., that transfer.amount cannot be more than the current balance of the BankAccount?
I can create a preCondition for the executeTransfer() operation, but how do I access the attributes of the transfer parameter?
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05235 seconds