Timeline for In DDD, is validation application logic, or domain logic?
Current License: CC BY-SA 3.0
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 6, 2020 at 4:27 | comment | added | alaboudi | Anti-corruption is a term that just means that we should adapt external data shapes to value objects or entities in your domain to maintain. The UI is an external agent to the domain as much as a database or other adjacent domains are. Can you explain your perspective as to why you consider UI not to be external to the domain and what you think I am confused by? "I would suggest you try to actually read about it in the DDD book." - jeeeeez. I am proud to say I have read the book and that I'd never lord it over people like that. be nice | |
| Dec 5, 2020 at 16:14 | comment | added | Rogério | @alaboudi I suspect you are confusing data coming from the UI with "external objects". Such data has nothing to do with what an Anti-corruption layer is about. I would suggest you try to actually read about it in the DDD book. | |
| Dec 3, 2020 at 4:10 | comment | added | alaboudi | @Rogério the spirit of an anti corruption layer is ensure that you don't corrupt domain definitions by allowing external objects leak into your domain. Controllers are an area where such leakage from an externality can occur. You should put an anti corruption layer there as much as you when invoke an external system | |
| Apr 17, 2020 at 22:56 | comment | added | Rogério | @Tebo The DDD "Anti-corruption layer" has nothing to do, per se, with DTOs, and it's not about data that gets passed from the UI and Application layers to the Domain layer. Maybe you should read the DDD book... (Also, "layers" are not "systems", they are layers in a single system, as described in the DDD book). | |
| Apr 11, 2020 at 23:27 | comment | added | Orson | @Rogério If you validate user input (some kind of DTO) at the Domain Layer, you would corrupt the Domain Layer. If you can see the Application Layer and Domain Layer as systems, then you would understand what he is saying. The primary function of an anti-corruption layer is to prevent corruption. | |
| Aug 8, 2019 at 17:35 | comment | added | Rogério | This answer makes no sense. DDD's Anti-Corruption Layer is extra code you write in order to translate to/from an external (of another system) domain model and your DDD-based application's domain model. If there is no such external system, there is no Anti-Corruption layer. Also, validating business rules belongs in the Domain Model (and Domain layer), not the Application layer. As for DTOs, this is a technical component (in the Application layer) which may or may not exist in a DDD app. Converting between DTOs and Entities/ValueObjects has nothing to do with Anti-Corruption layers. | |
| Jun 27, 2018 at 2:18 | comment | added | timetofly | @inf3rno because the questions specifically asked about validating a form, which is not related to the domain | |
| Apr 12, 2017 at 7:31 | history | edited | CommunityBot |
replaced http://programmers.stackexchange.com/ with https://softwareengineering.stackexchange.com/
|
|
| Mar 4, 2017 at 17:21 | comment | added | inf3rno | Why application is the answer? According to your text the formal validation can be done both in the domain or in the application and the business validation in the domain only. | |
| Apr 11, 2016 at 6:44 | vote | accept | Extrakun | ||
| Apr 7, 2016 at 14:27 | history | edited | VoiceOfUnreason | CC BY-SA 3.0 |
added 139 characters in body
|
| Apr 6, 2016 at 14:50 | history | answered | VoiceOfUnreason | CC BY-SA 3.0 |