5 responses to “Builder Pattern For Complex Validations”

Can you use the framework for validating against the db say for Login validation? I was thinking of writing isLoginValid which returns a LoginValidator and it throws an exception with invalid username password when the user cannot be found in the db.

Or would you only use the framework for validating null, Object instances etc.?

Hi Rentius
I recently used this technique of validation in a small project. And that was the time I realized the potential of this validation technique. And of course one can use it for various validations like login.

You’ll be glad to know, that I found some design problems with this technique and fixed it before implementing it in another project. Which has actually expanded it possibilities and scope.

Your question has inspired me to upload the new version. I’ll make sure I cut a branch in git for the updated version soon. 🙂