Search⌘ K
AI Features

Layers

Explore the four layers of hexagonal architecture—domain objects, use cases, ports, and adapters—to understand how to organize application components and clearly separate business logic from external systems.

As with any other architectural pattern, hexagonal architecture defines some layers that should be followed. We will learn about these layers in this lesson.

The layers of hexagonal architecture

Hexagonal architecture defines four layers to structure a component. As was mentioned before, these layers are focused on all of the parts that an application consists of, such as frameworks, database connections, business flows, and so on. Let’s look at them one by one.

Domain objects layer

Located in the center of the hexagon, a domain contains all of the objects related to the business. In DDD terms, business objects ...