Question

Back in October, Kristopher Johnson asked about Accounting Software Design Patterns

He received several answers, but they were all basically the same, pointing to Martin Fowlers Accounting Patterns.

I don't really find Fowlers patterns all that useful. They seem overly complex for a more simplistic accounting system, so I'm rehashing Kristopher's question and looking for more options, preferably for smaller systems.

This would be primarily a cash based system in which users are given accounts similar to a bank. They can log in (web based) and check balances, make certain transactions, etc..

I guess it would be more similar to a Paypal or Credit Card company than a bank, but on a smaller scale. It won't have to deal with taxes, or Amortizations, or any of the things you would see in a full fledged accounting system. Just balances, and transactions.

So can anyone point to any additional resources for accounting based software design or even good implementations of a simple accounting system?

Was it helpful?

Solution

So can anyone point to any additional resources for accounting based software design or even good implementations of a simple accounting system?

The Free Digital Money Project looks helpful for your needs. It provides a basic transaction and balance framework. It is intentionally simple and abstract, so may offer useful design insights, particularly if you want to test novel ideas.

Cyclos is more practical. It covers user accounts and transactions.

MyBanco is another open source banking system, supporting user bank accounts and web-based access. It can be used with both virtual and real currencies.

All of these are open source so you can check out the docs, architecture and code directly.

As an aside, if you are really only interested in balances and transactions, then it sounds like any pattern or project related to reputation, karma, or points systems will likely have relevant overlap...

OTHER TIPS

Fowler's patterns are not overly complex. They are about what is needed. You are unlikely to be able to build something simpler without getting in trouble with either the end users or the accountant.

When I implement accounting it's the typical model of a journals, transactions and accounts and account types.

tblTransactions
    - Amount
    - AccountID1
    - AccountID2
    - Type [CR/DR]
    - DateEntered

I then also have a tblJournals which groups transactions on the obvious basis. You may also add JournalTypes, which hold a general description of what sort of journal it is, so you can detect nice things (reverals, etc).

It's nice, because reversals under this model are trivial. You can just gather all the transactions for your journal, and swap the type.

The tblTransactions has a trigger, and the trigger updates a 'CalculatedBalance' against the specific accounts depending on the type. You can then also run a report over a given period, and so on.

It doesn't require much accounting knowledge to implement this and is simple, yet effective.

Google search for "two phase commit"

Not a design pattern per se but you need to make sure operations like "transfer $amount from $account1 to $account2" don't ever "withdraw" without the matching "deposit"... i.e. if the power goes out before the "deposit" completes, the "withdraw" is rolled back (undone)

Commit-able Transactions are made up of undo-able (rollback-able) sub-transactions...

  1. acquire permissions needed: trivial rejection, "insufficient funds"
  2. start a "two phase commit"
  3. add sub-transactions
  4. commit or roll-back

Warning: BCD math was invented to prevent round-off error in Base 10 math. You don't mention international issues, but you'd need fixed-point or "large precision" math, currency conversion, and all the rest...

I am actually the author of MyBanco, if you would like any help, just drop me an email :)

Store money as cents (integer) instead of dollars (float). It's not a design but it's probably more useful.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top