Answer the question
In order to leave comments, you need to log in
Leakage or what dependencies can there be between layers in DDD?
I study DDD and undertook to refactor the architecture of the application using this approach.
There are 4 layers:
- Application
- Domain
- Infrastructure
- Presentation
The whole thing collects the Application Module using the LUMEN framework.
I have questions regarding the connectivity between the Application, Infrastructure and Presentation layers.
For example, we have a hydrator that can convert an entity to an array and vice versa. As I understood its place in Infrastructure. And I need this hydrator in Application and Presentation. And because of the data types, the hydrator is very highly specialized, so it doesn’t really need an interface.
class Hydrator {
public function hydrate(array $data, string $className): object
{
}
public function extract($entity): array
{
}
}
Answer the question
In order to leave comments, you need to log in
Presentaion > Application > Domain > Infrastructure
It's simple: from left to right you can call even with a layer skip, from right to left - no.
Answers:
1. They can.
2. If several implementations are meant, then yes.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question