mbrowne's javascript DCI example uses the banker role in the TransferMoney example.
role banker {
transfer() {
source.withdraw();
destination.deposit();
}
}
However, in Trygve's book "the Common Sense of Object Oriented Programming" page 20,
Trygve let TransferMoneySource role initiate the transfer (instead of banker role)
role source {
transfer() {
this.withdraw();
destination.deposit();
}
}
Which way is preferred by DCI?
1. a coordinator (i.e., a banker role) to supervise the interaction of objects
2. let objects "talk" to each other