[ASP.NET] B-Logic Services, Validation
I am using anemic models, therefore I want to implement Business Logic Services.
And the questions are:
1) When to create a service? Should it cover entity and entities related to it (like aggregate in DDD)
Example: I have a class Book, that uses Description, Authors objects in it.
Should I create a class BookService that can manage Books and their descriptions and authors, or should I create + 2 service classes for the related entites and use them along with the BookService?
When do I separate the logic in them?
2) What should the methods return? I am aware of concept of Either/Result, but I don't want to implement them
3) Should I throw exception directly in these methods and rely on some middleware to make them shiny for the UI?
And the questions are:
1) When to create a service? Should it cover entity and entities related to it (like aggregate in DDD)
Example: I have a class Book, that uses Description, Authors objects in it.
Should I create a class BookService that can manage Books and their descriptions and authors, or should I create + 2 service classes for the related entites and use them along with the BookService?
When do I separate the logic in them?
2) What should the methods return? I am aware of concept of Either/Result, but I don't want to implement them
3) Should I throw exception directly in these methods and rely on some middleware to make them shiny for the UI?