DebtPaymentStrategy duplicates a lot of the logic of TransactionStrategy. It would be much simpler if DebtPaymentStrategy subclassed or encapsulated TransactionStrategy.
The DebtPaymentStrategy strategy methods could simply define an account order and leave it to the TransactionStrategy to execute an ordered strategy. This might be a bit tricky via encapsulation (there isn't currently a convenient way to set per-Account object weights, since weights are set by type, not instance). Subclassing might work better, but we'd need a way to de-register a strategy method. See #24 for a proposal to add such functionality.
DebtPaymentStrategy
duplicates a lot of the logic ofTransactionStrategy
. It would be much simpler ifDebtPaymentStrategy
subclassed or encapsulatedTransactionStrategy
.The
DebtPaymentStrategy
strategy methods could simply define an account order and leave it to theTransactionStrategy
to execute an ordered strategy. This might be a bit tricky via encapsulation (there isn't currently a convenient way to set per-Account
object weights, since weights are set by type, not instance). Subclassing might work better, but we'd need a way to de-register a strategy method. See #24 for a proposal to add such functionality.