Best spot for logic to return subsets of lists

Best spot for logic to return subsets of lists

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


Jack posted on Friday, July 03, 2009

I have a master ROLB with all the data I need.  However in my UI I need subsets of that list for various lists / trees etc.  I'm curious where people are putting that logic?  In the ROLB or in the parent object that actually owns it?

ie)  given BOParent /w ROLB SomeList as a child

subsetList ParentBO.GetSubsetA (some criteria)
{
     var SubsetList = SomeList.DoSomeLinqQuery
}

or

subsetList = SomeList.GetSubset(someCriteria)

Thanks

jack


skagen00 replied on Friday, July 03, 2009

That's a good question - I have done this sort of thing as well and I think I ended up putting it in the parent. Thus...

Person.Addresses (master liist)
Person.HomeAddresses
Person.WorkAddresses

I suppose probably it might be better if it existed in the ROLB since the actual business logic of differentiating addresses between work and home would be more appropriately done by the address collection looking at the addresses within the collection.

My usage is a bit more brief than the probably more proper way: Person.Addresses.HomeAddresses

In the end it's probably not too huge a deal, but that's my take.

Copyright (c) Marimer LLC