#Hexagonal architecture + DDD. Questions about the implementation

1 messages · Page 1 of 1 (latest)

molten rampart
#

Hi!

Currently, I am trying to implement these two architectures together with Java and Spring (although technology shouldn't matter I think).

But I'm encountering problems getting them to work together.

I understand that my application should have a structure with 2 zones (inside and outside the hexagon) and 3 layers:

Domain: Entities that should be self-contained with their own functionality, Repositories, ValueObjects, Factories, Events, etc. This layer is the center of the hexagon.

Application: Where the ports should be found. I've also seen that this is where REST or "input" adapters are typically implemented. This layer is at the edge of the hexagon.

Infrastructure: the implementation of the output ports, where external libraries and frameworks should already be used. This layer is outside the hexagon.

Are these concepts correct? Or am I wrong?

But this raises several questions for me. In the examples that I have been finding i find adapters implemented in the application layer or in the infrastructure layer, depending on whether they are input or output, but application layer cannot has Spring Framework because its inside of the hexagon, right?

What do repositories and domain services do? Shouldn't these be in the application layer as interfaces, and infrastructure should implement them? After all, all the logic should go in the entity.

I also made a small implementation on the github repository as a test, but I think it's a bit of a mess right now. https://github.com/rudahee/ddd_hexa-test

Could you clarify these doubts for me and give me some steps to continue doing this?

GitHub

Contribute to rudahee/ddd_hexa-test development by creating an account on GitHub.

indigo tulipBOT
#

<@&987246841693360200> please have a look, thanks.

indigo tulipBOT
molten rampart
#

anyone can help? u.u