I m working on a system which get thousands of requests per second, and essentially one of the tasks we are trying to avoid is to create unnecessary/extra objects.
We need to validate incoming request for 6 request items per se.
I m thinking of creating a class per each item validation.
However, I m trying to justify if i should use static validation classes vs object with instances that contains HttpRequest
as the instance field.
should i use static classes or objects? what would you do?
Essentially, what I m doing is injecting List<IValidator> validators
to request handler and iterating over it. but not sure if i should have an instance vs static classes.