Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 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. Commented Mar 4, 2017 at 17:21
  • @inf3rno because the questions specifically asked about validating a form, which is not related to the domain Commented Jun 27, 2018 at 2:18
  • 21
    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. Commented Aug 8, 2019 at 17:35
  • 1
    @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). Commented Apr 17, 2020 at 22:56
  • 1
    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 Commented Dec 6, 2020 at 4:27