OK i have seen other posts about this but none really specifically answer my question.
Where in an application should validation logic be?
I have a small application that allows new products to be instered into an applications database. There are different products with different fields i.e. product name, order number, description etc. New products can be inserted and existing products can be updated. Therefore when a new product is being inserted then all fields must be validated but when an existing product is being updated then only the fields being updated need to be validated i.e. maybe just the descirption is being updated so only that field should be validated.
Im thinking of an abstract class and two concrete classes for full and part product validators, each having their own validation logic contained at class level.
I have the feeling though that there must be a better pattern for this - any advice?