Replies: 1 comment 1 reply
-
I think this sentence is not phrased well. All I meant is that repository concrete implementations can be placed in a infrastructure layer (or Data Access Layer if you prefer). Domain Layer only depends on an interface and doesn't care if you use MySQL or MongoDB or anything else. And when you call a Repository from a domain layer, infrastructure layer (or DAL) makes sure to call the correct database. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, first I want to say that I really like this repo and the work put in! Hats off!
I can not quite agree with this sentence though:
"Infrastructure layer uses a mapper to convert data to format that it needs, uses repositories to fetch/persist data and adapters to send events or do other I/O communications, maps data back to domain format and returns it back to Application service;"
According to DDD and the Repository Pattern the Infrastructure Layer definitely should NOT use Repositories as they mimick an in-memory collection, returning Aggregates from the DOMAIN Layer. The Infrastructure Layer can use APIs to read/write data in external services but not Repositories. The Infrastructure Layer should also not have direct access to the Domain Layer, making this point even clearer.
Beta Was this translation helpful? Give feedback.
All reactions