Extending the Validation Application Block
You extend the Validation Application Block through designated extension points. Typically, these are custom classes written by you that implement a particular interface or derive from an abstract class. Because these custom classes exist in your application space, you do not have to modify or rebuild the Validation Application Block; instead, you can designate your extensions through configuration settings.
You can extend the Validation Application Block by implementing new validators. You can create your own Validator classes and your own attributes if the ones provided with the Validation Application Block do not fit your requirements. These classes could validate data types in new ways or they could deal with more complex data types, such as a Customer data type that includes many different data types.
The following table lists the base classes that you can use to extend the block.
Custom Provider or Extension |
Base Class |
---|---|
Validator |
Validator<T> or Validator |
Validator Attribute |
ValueValidatorAttribute |
You can extend the Validator<T> base class to create strongly typed validators. You can use the Validator base class to create loosely typed validators.
For detailed information about how to integrate custom providers with the Enterprise Library configuration system and configuration tools see Creating Custom Providers for Enterprise Library.