.netvalidationenterprise-libraryvalidation-application-blfluentvalidation-2.0

.Net Object validation


Can I use Validation Application Block, for a high performance program? I mean when I'm getting objects from a stream and I need to validate their values as I parse data coming. As I understand reflection is involved...

Is there any alternative tools that i can use for object validation?


Solution

  • It will greatly depend on the definition of the objects you validate. Objects that contain many properties that need to be validated or even contain collections of objects that need to be validated, validation takes more time. However, in general, 1000 objects per second would certainly not be a problem for VAB.

    Validation Application Block caches the XML configuration file as a object graph in memory, so you don't have to worry about a file load and XML parse each time to validate objects. VAB has some pretty good optimizations.