2.1 and new static (type) validation

2.1 and new static (type) validation

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


jtgooding posted on Friday, September 08, 2006

I haven't had time to test this one, and was curious if someone else has already, but in the old way (instance) validation, if you inherited a business object, you would get the base and the current objects rules for a given business object.

With the new Type style business rules, does it handle inheritence? Such that the if I am validaitng a subclassed business object I will also get it's base validation type rules as well, or because they a different types will it not include them? Or does it check for base types as well.

Thanks
John

RockfordLhotka replied on Friday, September 08, 2006

Yes, that works fine. The reason is because your rules are added in AddBusinessRules() in each class. Your subclass does, of course, have to call base.AddBusinessRules() so the base class can add its rules to the list - but the result is a merged list of all rules up the inheritance chain.

Copyright (c) Marimer LLC