How do I know if I should put the method in the class itself or in the BO of the class? When to know the difference of domain logic and application logic? Note: I was left with the doubt after read this article
How do I know if I should put the method in the class itself or in the BO of the class? When to know the difference of domain logic and application logic? Note: I was left with the doubt after read this article
In DDD, we have the domain classes, which are our entities, our objects, and we also have the service classes.
The domain class is responsible for servicing the business, it is where it has entity validations, or some methods that do not require repository access, do not make calls to the database.
The class of service, is responsible for delegating, ie "serve" is in it that will have the entity do the verification and after the return, if everything works out it will delegate the method of saving in the repository for example.
It has a slideshare that is well chewed, and worth checking out.
I hope I have helped.