What does the single responsibility principle mean for validation
问题 Does the single responsibility principle mean that your validation rules should be external to the entity? If so do you use one class per validation rule? 回答1: I would normally interpret this to mean that en "entity" and the validation of an entity should be separate concerns. I would normally use a single class that can validate an entire entity, but I would see no reason to constrain its implementation by not letting that class use other classes. But I would not split validation of an