Reply to comment

Validation is a part of some specific case and model is general.

Very bad approach is to mix the "description of structures" (bean/entities) with a very specific to the case implementation.
CORBA and EJB 1-2.1 Entity Beans showed us how bad it was.
Session Beans, Web Services and SOA are examples of old good structural approach - not object oriented one.

In large systems, domain model is generated from from UML, and need to regenerated very often - where is a place for validations function, how to preserve the from be overwritten?

Model might be generic, and very elastic, with reuse and inheritance of entities like Address, Person, etc. What if domain model (set of bean/entity classes, of course) is common and critical resource for the large system, and different teams reuse this holly model - should every developer be free to rubbish entities of the model with some very specific validation?

More, ORM and relational to object mapping allows for multiple inheritance in database, and domain model might be not very clear, with "repeats". Where to put validation function in that case?

Reply

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.