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.
-
I'm not fully convinced that mapping to a DTO is beneficial here. I've seen way too many projects that have empty DTO layers being mapped to other empty DTO layers for the sake of architecture and decoupling. I want to see behavior in a layer, or another really good reason for it's existence. Types used internally within the same system are safer to use in multiple layers provided the IDE's refactoring tools allow you to easily restructure and reorganize the code base.Greg Burghardt– Greg Burghardt2024-09-26 04:20:33 +00:00Commented Sep 26, 2024 at 4:20
-
That being said, if types are used across different systems such that refactoring tools in the IDE don't help, now the layer has a good reason to exist. The decoupling the DTO provides insulates other systems or components from changes that are not easily fixed.Greg Burghardt– Greg Burghardt2024-09-26 04:25:03 +00:00Commented Sep 26, 2024 at 4:25
-
@GregBurghardt: Define "layer". Architecturally, I would refer to "the persistence layer", which includes in it any persistence logic and related mapping. But I would refer to the concept of mapping in and of itself as a "layer of abstraction", which is not referring to an "architecture layer" in the same sense that "persistence layer" would be. So when you say "I want to see behavior in a layer", I agree with you if you're referring to an architectural layer, but not if you're referring to the other definition of "layer" that I mentioned.Flater– Flater2024-09-26 04:58:28 +00:00Commented Sep 26, 2024 at 4:58
-
1@GregBurghardt: Maybe to put it differently I'm not advocating for an empty passthrough layer (i.e. a whole new service class) which does nothing but mapping. I'm advocating for the addition of a mapping to the existing layer (i.e. repository or similar service). Based on your feedback, I get the feeling that you may have interpreted this answer as suggesting the former.Flater– Flater2024-09-26 05:01:43 +00:00Commented Sep 26, 2024 at 5:01
-
Could I perhaps go a step further and propose that whatever structure sits atop a DAO (which we agree should exist in the vast majority of cases) must: 1. Implement an interface defined in the presentation layer, and 2. be introduced into the presentation layer via dependency injection?Andrew Jackson– Andrew Jackson2024-09-26 10:51:53 +00:00Commented Sep 26, 2024 at 10:51
|
Show 1 more comment
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