clsRulesManagerBase¶
clsRulesManagerBase is an abstract base class that exposes RuleBroken/RuleNotBroken events, implementing a business-rule-violation notification pattern for subclasses elsewhere in the SAIF BOF stack.
Purpose¶
- Provide a reusable rule-violation notification mechanism (
RuleBroken/RuleNotBrokenevents) for business object subclasses; contains no concrete rule evaluation or validation logic itself.
Context¶
- Namespace:
SAIF.Framework - Assembly/package:
SAIF.BOF.Framework.Bindable.csproj(packed into theSAIF.BOF.FrameworkNuGet package)*
Public members¶
| Member | Signature | Purpose |
|---|---|---|
RuleBroken |
event RuleEvent RuleBroken |
Serialization-safe ([NonSerialized]) event raised when a subclass reports a business rule has been broken. |
RuleNotBroken |
event RuleEvent RuleNotBroken |
Serialization-safe ([NonSerialized]) event raised when a subclass reports a previously-broken business rule is resolved. |
Behavioral notes¶
- The protected
OnRuleBroken(object rule)andOnRuleNotBroken(object rule)methods invoke their respective event delegates directly (RuleBroken(rule),RuleNotBroken(rule)) with no null-check guard, so calling either method with zero subscribers throws aNullReferenceExceptionat runtime.* This is the mechanism documented in BR-001. - This contrasts with the guarded pattern used in
clsBindableBase.OnIsModifiedChanged(), which checksif (IsModifiedChanged != null)before raising its event. - No consumers of this class exist within this library's own source; actual subclassing usage is outside this library's scope and unverified.**
Constraints and usage notes¶
- Consumers must ensure a subscriber is always attached to
RuleBroken/RuleNotBrokenbefore a subclass callsOnRuleBroken/OnRuleNotBroken, or an unhandledNullReferenceExceptionwill be thrown. See BR-001. - The
RuleBrokenandRuleNotBrokenevents are marked[NonSerialized], so they are excluded from binary/XML serialization of the subclass instance.
Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.
Sources¶
SAIF.Framework.Bindable\clsrulesmanagerbase.cs