BusinessRules for collection Classes

BusinessRules for collection Classes

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


Jimbo posted on Wednesday, January 03, 2007

This is probably a question for Rocky, but in the process of implementing both root and child collection classes (ListBase) I have come across situations where we would seem to like to see the implementation of Type/Instance Business rules - in much the same manner as you would do in a root BusinessBase sub class.

For example at the simplest level, a collection could have a rule that it cant be an empty collection. The only way to enforce this for a child collection is via the IsValid property of the parent. - No chance if its a root collection.

A root (or child) collection might need to have a few key properties around the collection itself. Say when it represents a batch of items to be posted with a common batch No or Date property.  I agree that you could have a parent business class(with BusinessRules)  to host the collection - but why? -  when its just one or two common properties that require validation.


JoeFallon1 replied on Wednesday, January 03, 2007

I tend to agree that it would be nice if Editable Child Collections could also have Business Rules.

I always add those kinds of rules to the Parent BO that contains the collection (because there is no where else to put them.)

Joe

 

Copyright (c) Marimer LLC