Timeline for DDD Application Service Architecture Question
Current License: CC BY-SA 4.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 16, 2020 at 10:01 | history | edited | CommunityBot |
Commonmark migration
|
|
| Aug 21, 2018 at 21:26 | comment | added | Anup Marwadi | That is correct. So I was thinking of loading the State Province (and it loading the Country with it). Another alternative (albeit expensive one) is to load the Country and all its State provinces and still pass Country and State Province code. The earlier approach is much better because I can load the state based on CountryCode and StateCode and if that matches, I get a StateProvince with Country back which I pass to the domain model | |
| Aug 21, 2018 at 19:48 | comment | added | Christophe | Yes: a clear separation of concerns is the correct approach. The domain service approach presented in that article is correct and you could use it. You could also get the country via a repository. In my opinion, the StateProvince is however an entity belonging to the Country aggregate, because the StateProvince identifier fully depends on the country cpde. | |
| Aug 21, 2018 at 18:43 | comment | added | Anup Marwadi | I agree on the Validation being a part of the Address domain. If I'm understanding you right, the application concerns should not be mixed with the domain concerns. Using this Domain Service approach: zankavtaskin.com/2013/11/… would you recommend that I simply pass a StateProvince as an argument to the constructor? This will ensure that the Country that the state belongs to is also passed implicitly with the StateProvince. The domain service would load the state by code using a repository and pass it to the Domain model. Thoughts? | |
| Aug 21, 2018 at 18:12 | vote | accept | Anup Marwadi | ||
| Aug 19, 2018 at 19:00 | history | answered | Christophe | CC BY-SA 4.0 |