Layers

Learn what hexagonal architecture layers are and how they interact with each other.

As with any other architectural pattern, hexagonal architecture defines some layers that have to be followed to succeed. Those layers are going to be covered in this lesson.

Hexagonal architecture layers

Hexagonal architecture defines four layers to structure a component. As mentioned before, they are focused on all parts an application may have such as frameworks, database connections, business flows, and many more.

Domain objects

Located in the center of the hexagon, it contains all objects related to the business. In the Domain-Driven Design terms, business objects are entities, value objects, and aggregates. Additionally, this layer contains all abstractions defined to carry out a business process. The abstractions are factories and the definition of repositories. Services can have two possibilities, if they interact with external dependencies, this layer will only have the definition of them. If not, this layer will have all the implementation.

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy