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*
- Indeed, this removes the need for using the file path as the identity. However, I'm anticipating the day when we don't want to manage files anymore, in favor of cloud resources for instance. So I'm wondering if can get rid of any aspect of the file in our BCs.Loïc Morvan– Loïc Morvan2020-12-04 16:13:43 +00:00Commented Dec 4, 2020 at 16:13
- I guess the entities known to your business are some kind of documents, not files. I rephrased the value object to DocumentId. When you hydrate your document aggregates from the data source (here a filesystem) you do not need to know anything about files. I was assuming that anyway. So your aggregate would be something like Document maintained in the document repository. Only the repository implementation knows about files. When you want to switch to another data source you can simply change the concrete repo implementation leaving the repo interface including the DocumentId value object as isAndreas Hütter– Andreas Hütter2020-12-04 16:45:14 +00:00Commented Dec 4, 2020 at 16:45
- If entities are considered as document, then the DocumentId would directly be the identity of the entity, isn't it? In practice, your solution may be totally useful. However, I have the feeling that adding a DocumentId property is not strictly DDD-compliant.Loïc Morvan– Loïc Morvan2020-12-07 08:22:42 +00:00Commented Dec 7, 2020 at 8:22
- DocumentId is just a proposal for the name. The important thing is, that from how understand from your problem description, that this is really about documents existing in the problem domain of your business. Like a word document is known to the users of Microsoft Word. So I guess there is also some kind of identification of a document which the user of your desktop application is opening and saving to. So I do not understand why such an identification is not DDD-compliant. The value object can also be DocumentName or whatever makes sense in your domain.Andreas Hütter– Andreas Hütter2020-12-10 19:21:34 +00:00Commented Dec 10, 2020 at 19:21
Add a 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