So I am debating what approach to follow. My scenario is : Will receive a POJO which I need to validate ( REST end point ) Now I can explicitly validate specific fields ( which I know / are stated in requirements that they are mandatory ) OR should I define the fields in a db table and define which are mandatory vs not and then read this table one time and then based on what is configured in db drive my validations .
Would the second config driven approach be an overkill ? ( I guess the answer would be 'depending' on the number of times such scenarios can arise where we would need to change the rules of what is mandatory )
apologies if I am not making sense