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*
- 2"couldn't we still argue that such Domain Objects contain Infrastructure-related logic and thus still violate PI?" No, because "these Domain Object[s] are [still] completely unaware of how they are being persisted."Robert Harvey– Robert Harvey2013-01-08 19:28:37 +00:00Commented Jan 8, 2013 at 19:28
- 1Then put the infrastructure-related logic in the repository; i.e. cache it. But the key word here is "persistence." An object that is "caching itself" is not persisting itself (i.e. writing it to a storage device); it is merely remembering some previous value.Robert Harvey– Robert Harvey2013-01-08 19:42:08 +00:00Commented Jan 8, 2013 at 19:42
- 1There are always things that you need to do to your domain objects to make things work with some of the popular ORM's, whether it be virtualising your members, or decorating them with attributes. My question is what is the risk of doing that? At some stage you have to make a decision on how you are going to persist your objects and its unlikely going to change once the decision is made. So is it really that bad? If keeping your domain free of influence from ORM is important to you then maybe don't use an ORM and look at alternative persistence solutions such as NoSQL.stephenl– stephenl2013-01-08 19:49:43 +00:00Commented Jan 8, 2013 at 19:49
- 3It all comes down to practicality, not slavishly adhering to some abstract principle. I personally believe that there's no such thing as 100% persistence ignorance, since requesting an object requires some form of ID, and that ID is going to be supplied by, and dependent upon, the persistence mechanism.Robert Harvey– Robert Harvey2013-01-08 20:16:01 +00:00Commented Jan 8, 2013 at 20:16
- 1As an aside, I don't like the term "ORM POCO". It's either an ORM-aware class, or it's a POCO. I don't see how it can be both. But, just in case there is such a thing as an "ORM POCO"... If it's truly a POCO, and it matches your domain requirements, then does it matter if it was generated by an ORM?Eric King– Eric King2013-01-08 20:54:26 +00:00Commented Jan 8, 2013 at 20:54
| Show 5 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