Open mirkadev opened 3 years ago
Validation is related to the entities, and is part of the business logic that ensures that the entities are subjected to the rules that are compliant with the business objectives. So entity validation belongs in the domain layer (where it is).
Uncle Bob himself clarifying on this.
https://groups.google.com/g/clean-code-discussion/c/latn4x6Zo7w/m/bFwtDI1XSA8J
Uncle Bob himself clarifying on this.
https://groups.google.com/g/clean-code-discussion/c/latn4x6Zo7w/m/bFwtDI1XSA8J
Big thanks!
Hi Bill! Thanks a lot for your code - it was really useful for me. I have the next question - how correct is it to use validation in entities? Is it still within business rules? Maybe we should use validation in other layers of the application?