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*
-
1"My goal is to eliminate the Adapters and Presenters and make the DTOs build themselves" I'm unclear as to why this is your goal. There are a number of things that can only be done in a constructor but doing a lot of logic in one is a bad idea in my experience and often just moving things out of the constructor can cause awkwardness and problems to vanish.JimmyJames– JimmyJames2025-07-18 20:40:19 +00:00Commented Jul 18, 2025 at 20:40
-
1In my opinion, the basis of the posted question is missing the mark. Mapping is not something that operates on a single object, it's a transferral from one structure to another. When you say that an object should construct itself - what should it construct itself from? What if there are multiple sources? What if the construction takes a significant amount of effort relative to the complexity of the target type in and of itself? This is effectively arguing that how to construct an object is the same responsibility as that of the object itself. That is not always a given, only sometimes.Flater– Flater2025-07-18 23:49:44 +00:00Commented Jul 18, 2025 at 23:49
-
1Sometimes the mapping is so trivial that it doesn't matter that you add it into the class. But that is not a given for every use case. So this becomes an argument of exactly how complex something has to be for it to warrant being in a separate mapper. And realistically, a lot of senior devs I know find it easier to simply create the mapper as a consistent pattern across their codebase, rather than having to judge every single case and argue about where it falls on the spectrum of making a separate mapper or not. Sure, maybe there's some overkill but it saves a bunch of time arguing.Flater– Flater2025-07-18 23:52:03 +00:00Commented Jul 18, 2025 at 23:52
-
1[...] plus it increases codebase structure consistency, rather than having to be aware of each individual design decision that was made for each individual scenario.Flater– Flater2025-07-19 00:01:40 +00:00Commented Jul 19, 2025 at 0:01
-
1Does not DDD forbids Domain to know about DTOs?Basilevs– Basilevs2025-07-19 09:51:10 +00:00Commented Jul 19, 2025 at 9:51
|
Show 9 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
-
create code fences with backticks ` or tildes ~
```
like so
``` -
add language identifier to highlight code
```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible)
<https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you