Ravi.Kumar
Ravi.Kumar

Reputation: 767

Design Pattern for accounting hierarchy

I am creating a accounting hierarchy for the financial domain of an application. My requirement is to create an accounting hierarchy for some object. I need to ensure that the code I will write should be generic so that it can be used with other objects. Should I need to use some design pattern for it or just one java class. I need some suggestions.

Thank you. Ravi

Upvotes: 2

Views: 1339

Answers (2)

Jordão
Jordão

Reputation: 56467

There are many analysis patterns (pdf) that can apply to an accounting system.

Accounts tie Parties with Accounting Entries, which originate from Accounting Transactions that can be created from Posting Rules. Accounts can be connected to other accounts with schemes such as Derived Account or Summary Account. An Accounting Practice encapsulates the rules in effect in a defined context.

Take a look at the following books: Analysis Patterns (Martin Fowler) and Domain Driven Design (Eric Evans).

Upvotes: 0

dantuch
dantuch

Reputation: 9283

From my point of view... when I hear account, I think State.

look here, why:

enter image description here

(This picture belongs to http://www.bnsit.pl/)

Of course you can use your own implementing classes and interface, that will fit your needs. But the idea is still the same - there's one interface that represents whole account classes, and there are some implementations, that allows you do or do not implemented methods, accordingly to the state of given account.

Upvotes: 3

Related Questions