CompositeRuleset Checked-in

Topics: Development Team Discussion, User Discussion
Coordinator
Sep 16, 2007 at 2:53 PM
Here's a first draft (meaning no comments and almost no UTs) at a CompositeRulesetValidator.

It allows composition of rulesets into higher rulesets.

One think I am wondering is wheter or not it could be useful to be able to specify the CompositionType of rulesets, the same way it works with validators.

[CompositeRuleSetValidator(Ruleset="NewCustomer", TargetRulesets="Named,Reachable")]
[CompositeRuleSetValidator(Ruleset="CustomerWithOrders", TargetRulesets="NewCustomer,Billable")]
public class Customer
{
[NotNullValidator(Ruleset="Named")]
public string Name;

[NotNullValidator(Ruleset="Reachable")]
public Address Address;

[NotNullValidator(Ruleset="Billable")]
public Account Account;
}

Any thougths?
Sep 17, 2007 at 9:33 AM
Cool. seriously!

I'll have a brief look into whether some of this can share code with the ExternallyConfigurableObjectValidator (since from the first look of it both seem to tackle a similar problem).
am i right?

thanks
Coordinator
Sep 17, 2007 at 11:09 AM
Actually you are right.

If you use the CompositeRuleSet and specify a ConfigurationSourceName which happens to be configured as a FileConfigurationSource in you app settings AND specify a single target rule set in the TargetRuleSets property, you obtain equivalent behavior.
Sep 25, 2007 at 7:47 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.