In my Springboot project I need to perform a validation of the type
I was wondering whether would it be a good or bad practice to place a validation in the model itself (pros and cons?) or should it be in the controller which feeds the value in model.
I have taken reference from this question In MVC should a model handle validation?.
In it the accepted answers favors for the case of date validation in model, but there are answers which contradict as well. So I would like to have clearer view on the topic.
Which clearly provides some insights, but I was looking for this particular scenario. (As a concrete example for the above question).
Thanks very much for any insights!