AddBusinessRules Question

AddBusinessRules Question

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


jkellywilkerson posted on Thursday, August 16, 2007

Greetings All,

I am sure that this is a very simple question...I just need some verification.  I am moving from the 2.0.3 version to 3.0.1.  I seem to remember some discussion about type and instance rules and changes to the framework to allow rules to be loaded once for a particular business object or once for each instance of a business object.  All is well so far.

I just need verification that the AddBusinessRules method, along with ValidationRules.AddRule, is for the addition of rules that apply to BO (loaded once per type) and the AddInstanceBusinessRules, along with ValidationRules.AddInstanceRule, is for the addition of rules that apply the each instance of the BO (loaded once per instance).

I know that it seems obvious when looking at the names, but, I guess I thought I would experience a breaking change when making the switch.  Everything appears to work.  Am I to assume that I designed all of my BO, so far, to use the "per type" method, or is there something else I need to look at to consider the version update.

Thanks,

Kelly.

david.wendelken replied on Thursday, August 16, 2007

Kelly,

You are correct.

When the per-type rule option was added, Rocky polled the developers to see whether they preferred their old per-instance rules to automatically switch to per-type rules.  The answer was a unanimous "YES".

It was pointed out that anyone who didn't want to do that could very easily do a global search and replace on their business object libraries and get the old behaviour.

jkellywilkerson replied on Thursday, August 16, 2007

Thanks David...I just wanted to make sure I didn't have it backwards and make unnecessary changes to all my objects.

Kelly.

Copyright (c) Marimer LLC