Advice on how to implement.

Advice on how to implement.

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


ajj3085 posted on Friday, October 06, 2006

Hi,

I have a collection of line items.  The user needs the ability to arbitraraly group line items.  The group is moved in the list as a unit, the total price is the sum of the items in the group.  Items in the group cannot be reordered once in the group. 

The functionality is such that there will be one or more line items in the LineItems collection.  These can be selected.  The group line item BO is crated by providing an IList<ILineItems>; each of the items is then put into an Items collection on the group line item. 

Obviously since the items are now contained in the Items of the Group line item, they should not be in the Document's LineItems collection.  Should the process of creating the Group line item remove them (similar to how binding used to work.. the child is asked to remove itself, and then delegates to the collection to perform that task), or should the document's LineItems collection handle this when a GroupLineItem is inserted? (This would be done in the InsertItem method override).

Thanks for any suggestions
Andy

ajj3085 replied on Friday, October 06, 2006

No one has any ideas?

rhoeting replied on Friday, October 06, 2006

So this is a question of "where to put logic" as opposed to "how to write the logic", correct?

Rob

ajj3085 replied on Monday, October 09, 2006

Yes.  Also, if this is even a good idea to begin with.  Maybe the UI should remove the items itself?

rhoeting replied on Monday, October 09, 2006

Not sure if this will help you, but whenever I come across these "where to put BL" questions, I pretend I will need to the logic to work in other contexts, such as batch, web service, or web:  "If I had to write a batch routine to automate this functionality down the road, where does the BL placement make the most sense?"

Doing this helps understand the true essence of the problem I'm trying to solve, or if the problem even makes sense.  Again, this may not help your for this particular problem...

Rob

Copyright (c) Marimer LLC