Object Design

Object Design

Old forum URL: forums.lhotka.net/forums/t/3450.aspx


MrPogo posted on Wednesday, August 29, 2007

I have a very complicated scenerio that maybe some one can help me clear the fog in my head.

Im making a system that will track revenue and items (tickets, etc.) given out.

I have a contact that can place an order.  On the order money is assigned to account which is assigned to a program.  The account can also assign tickets or other items. 

Well each program that an account is assigned to can have a matrix which assigns additional items(such as free parking, etc..) based of all the order a contact has placed and there program account value total.

The items would then be assigned through a transmittal across all orders so a contact could have 2 Program B orders and each order had 25 Item C totalling 50 Item C which would all be pulled together as 50 Item C on the Transmittal.  And due to both orders totaling x they also get 25 parking from the Matrix.

If you edit the order you cant remove items assigned.  Items can be removed from the transmittals though.

So I was thinking of a parent ContactDetail

with children Orders,Items,Matrixs, Transmittals

with Orders having Accounts,Items,Payments

I don't know if this would work though.  Am I over thinking this?

Thanks in advance,

John

RockfordLhotka replied on Wednesday, August 29, 2007

I got a bit lost in the domain-specific jargon. But it sure sounds like you have at least two use cases:

  1. Enter an order
  2. Send a transmittal

Each use case should have its own object model - and that may help clear things up all by itself.

Even so, it does sound like "Enter an order" has some complexity. When you assign the order to an account and program (1:1:1, or 1:1:n?) the program inserts some line items into the order that can't be removed.

But can they be removed if the program is changed? On the account? Or in some "Edit a program" use case?

There are too many unknowns to say for sure. But the core of your "Edit an order" model sounds like

Order contains Items
Order has Account

A sub-use case "Assign account to order" would probably trigger adding the mandatory line items to the order based on the program(s) behind that account.

MrPogo replied on Wednesday, August 29, 2007

Thanks for the reply!

I know this is the core and most complex part of the program.  I want to try to keep it as clean as possable but there are lots of rules and things tied together. The main goal is to be able to place orders through Accounts (Internal) or Items(Online).  But then they get additional things based on total of all accounts per program for all orders(Matrix).  An order and an account can house more than one program which means there can also be more than one matrix on the account(One per program).  The trickey part comes when one needs to edit an account that contains an item.  It can only remove value if an item has unassigned items in the Account list.  So the order has to be aware of the Account Item List. 

I will work more on the Use Case and maybe that will get me somewhere faster.  It's hard cause I understand all the functions but its hard to put into objects.

Thanks again,

John Wahlen

www.summerfest.com

 

Copyright (c) Marimer LLC