-
Notifications
You must be signed in to change notification settings - Fork 115
Description
Hi, Thanks for your awesome book! I have a question:
On page 306 your say:
Using a dedicated class per Application Service makes the code more robust against external changes (Single Responsibility Principle). There are fewer reasons to change the class, as the Service does one and only one thing. The Application Service will be easier to test, seeing as it does less things. It’s easier to implement a common Application Service contract, making class decoration easier (check out the chapter on transactions in Repositories). This will also result in higher cohesion, as all dependencies are exclusively dedicated to a single use case.
The execution method could have a more expressive name, like signUp. However, the execute Command pattern186 format standardizes a common contract across Application Services, thereby enabling easy decoration, which comes in handy for transactions.
How would you handle viewing " one wish" vs e.g. "All whishes"? Would this be:
- Two separate classes for the two use cases
- One class; Two methods
- One class; logic handled in the execute method based on parameter / request obj
- Another option?
Thanks.