samedi 26 septembre 2020

Design Pattern in C# for Input Validation

In my micro-service I have to check if the input request is valid or not. for validation we are using 10 different functions like Name Validation, Device Validation, Email Validation etc. Now I am thinking to use a design pattern for validation.

Initially I was think to use Strategy Design pattern but in my case either the request will pass all validation or it will break in between and nothing to decide at runtime.

Later I was thinking to use Chain of Responsibilities or Iterator but now I am confused which pattern should I use ?

Aucun commentaire:

Enregistrer un commentaire