Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.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?

like image 699
user3072 Avatar asked Feb 24 '26 11:02

user3072


1 Answers

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.

like image 60
Steven Avatar answered Feb 26 '26 00:02

Steven



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!