Saturday, 1 June 2013

How to implement inventory analysis pattern?

How to implement inventory analysis pattern?

I read about Martin Fowler's inventory analysis pattern from here: http://www.martinfowler.com/apsupp/accounting.pdf. It is interesting, but somehow I can't find a way to implement the pattern in a simple application.
For example, program is displaying a form for user to input order. An order consists of line items. If I didn't got it wrong, this is an Event which will be processed by PostingRule into one or more Entry objects.
When user click the 'save' button, what will be created? An Event or a group of Entry objects? Which one contains the line items? I will also need to display PostingRule result (money amount) to user before they confirm the order creation.
The pattern states that an Account have one or more Event. What Account should be used or created in this operation?
In the search operation, I need to display an order with its line items. How to do this? In the pattern, I have a lot of Entry and Event objects, but I don't have a Transaction that represent an individual order with its own line items.

No comments:

Post a Comment