You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Max Leuthäuser edited this page Nov 18, 2021
·
5 revisions
Title
Roles can play roles
Description
Consider the example where an employee (role of a person) can be a project leader, which is a role of the employee and now indirectly of the person itself.
valstan=Person("Stan")
valbrian=Person("Brian")
valaccForStan=newAccount(10)
valaccForBrian=newAccount(0)
val_=newBank {
valca=newCheckingsAccount()
valsa=newSavingsAccount()
roleGroups.checked {
accForStan play ca
accForBrian play sa
}
stan play newCustomer()
brian play newCustomer()
// ...
}
Both accounts (core objects/players) play the CheckingsAccount role, which itself plays the Source/Target role respectively.