-
-
Notifications
You must be signed in to change notification settings - Fork 12
Implementation Role Feature 22
Max Leuthäuser edited this page Oct 16, 2015
·
3 revisions
Compartments may play roles like objects
Compartments can be seen as entities similar to naturals being able to play roles, as well.
Compartment instances in SCROLL are either anonymously instantiated Traits or classes, hence they can play roles like any other object.
E.g.:
val transaction = new Transaction(Currency(10.0, "USD"))
// ...
accForStan play new transaction.Source
accForBrian play new transaction.Target
// ...
transaction play new TransactionRole execute()
Transaction
is a Compartment itself and plays the TransactionRole
inside the banking compartment.
(From: BankExample.scala)
None.