The Money Transfer Algorithm


The algorithm for transfering money can be found in the TransferMoneyContext class. It asks the MoneySource account to start things off; it starts a transaction and debits its balance, asking the MoneySink role to handle its side. The MoneySink increases its balance. At the end of their work each role updates its respective transaction logs. Finally a success splash screen is displayed and the algorithm terminates.

Paying Bills is a second use case that just loops through a list of accounts, creating a TransferMoney use case for each destination account to which money is owed.

The code can be studied by downloading and unpacking the tarball or by reading the HTML-file

C++ Money Transfer tarball.

C++ Money Transfer program listing.