Hi Samvan,
Thanks for buying the book!
I don't go into real detail on the role of the application layer apart from the paragraph on page 92. For more information refer to Evans Domain Driven Design book or check out the following article:
http://weblogs.asp.net/pgielens/arch...en-Design.aspx. In the book I use the application layer to convert domain entities into viewmodels (chapter 8) for the purpose of displaying in the UX.
Quote:
|
I am wondering why this is.. is it because we need to call the Apply method (the discount strategy) on the domain entity (list of Products) and we can't do it on the AppService layer?
|
Basically Yes. In chapter 3 the app service layer calls into the domain service, as the process of returning a list of products requires some business logic to be run (i.e. the working out of correct discount) and to my view this is a domain concern. In chapter 4 returning the list of bank accounts doesn't require any logic so it makes sense to go directly to the repository to return a list of all the accounts.
Hope that helps
Cheers
Scott
Please let me know what you think about the rest of the book or if you have any more questions.