Questions tagged [hexagonal-architecture]

The Hexagonal Architecture is a software architecture proposed by Alistair Cockburn. It is also called Ports and Adapters. It is similar to the Onion Architecture proposed by Jeffrey Palermo.

Alistair Cockburn proposed the Hexagonal Architecture, also called Ports and Adapters. The architecture is similar to the Onion Arcitecture proposed by Jeffrey Palermo.

The fundamental motivation of the approach is to avoid layer-to-layer dependencies usually associated with the N-tier architecture approach. This is achieved by placing all infrastructure, including databases, outside the problem domain.

The problem domain is then completely independent of the required infrastructure (testing, databases, security, etc.). For example, this means that testing database accesses can be done thoroughly without a real database.

176 questions
2
votes
2 answers

In an Onion type architecture, should the entities cross the outer layer?

I've been trying to understand this new kind of architecture which names can be Onion architecture, Clean architecture, Ports and Adapters, etc. If I take the abstraction of Ports and Adapters, when I adapt my application for a particular port, is…
1
vote
2 answers

Why does this ArchUnit test fails?

I have a demo project which tries to respect strictly clean/onion/hexagonal architecture. Here is how I configure ArchUnit test : @AnalyzeClasses(packages ="fr.tristan.demoassurance", importOptions = {ImportOption.DoNotIncludeTests.class,…
1
vote
1 answer

What IDE subprojects (=Maven ) dispatching for an hexagonal project? How many jars will be in the final executable jar? Ten, tens, hundreds?

Before starting to move to an hexagonal architecture, my application (roughly) had these jars, gathering into a bigger executable. (to be more precise, for a comment below: concretely each of my Maven subprojects () has a…
Marc Le Bihan
  • 2,308
  • 2
  • 23
  • 41
1
vote
1 answer

Need help to solidify my understanding of hexagonal / ports and adapters architecture

I'm trying to make sense of Hexagonal architecture and want to know if I am understanding this correctly. You have a application layer where your business logic exists. You have a port layer which is just interfaces used by the application layer…
1
vote
1 answer

how do I successfully to using hexagonsdk

when i install hexagon sdk 5.1.0.0 using QPM, error occured "hexagonsdk5x_jre.5.2.0.0.windows-x86.exe hexagonsdk5x_jre.5.2.0.0.windows-x86.exe was not installed". then install these deps using "java -jar .\utils\scripts\depDl.jar -c…
Chun Li
  • 13
  • 3
1
vote
1 answer

How to set relationship between entites in clean architecture?

Sample architecture Recently I started to learn Clean Architecture implementation. Now I'm stuck on the way to create my entities and create the between them. It's suggested in uncle Bob to have entities in each Domain. I can agree with that. But…
1
vote
1 answer

Hexagonal Architecture for a real-time stock watcher

I'm designing a stock market watcher system. It accepts registration of patterns from subscribers. Meanwhile it polls latest market info every few seconds, the it supports multiple market, so the polling interval, working hours are depend on…
1
vote
0 answers

Using a Transaction between Two different Ports in Hexagonal Architecture

We're using a hexagonal architecture in one of our microservice. Spring Boot is the framework implementing the service. For a use case, we need to update a database table (relational) and send a message to a Kafka topic. Quite usual. We don't want…
1
vote
2 answers

Microservices communication within bounded context

As a part of our DDD design, we are working on a bounded context and have identified two microservices A and B. Service A needs to make calls to Service B via REST API. Service B already provides open API spec on how to get any data. We use openapi…
1
vote
0 answers

Async response handling in hexagonal architecture should be driven or driver?

We are fairly new to hex arch in my team and trying to figure out best implementation for various scenarios. Most examples online illustrate the typical use case having command/query -> use case -> db/msg/api One scenario that has caused a lot of…
miklesw
  • 724
  • 1
  • 9
  • 25
1
vote
0 answers

How to externalize adapter artifact in Hexagonal Architecture?

I will explain my question with a simple example. We have 10 'hexagonal' microservices which work with the same database storage for auditing. This database has a schema that looks like a tree of objects used by the services similarly. So,…
1
vote
2 answers

domain driven design ports and adapters

I am new to DDD and I am trying to apply it with Hexagonal architecture. I have the following scenario: A user aggregate application service and third party REST API that I need to call before persisting the user to the repository So I am trying…
1
vote
1 answer

I have an interface (domain port) with several implementations (non-domain adapters). Where does the logic for choosing which adapter to use go?

Let's say I have a use case that needs to make calls to a client, defined as an interface, a port. I want to use one implementation (adapter) or another, for that port; and the choice of which one to use depends on business logic - say, the country…
1
vote
2 answers

How to use Spring cache in hexagonal architecture?

In hexagonal architecture, domain layer has no dépendency with framework. Is it possible to use Spring cache in domain layer ?
1
vote
2 answers

Dependency between adapters in hexagonal architecture Spring Boot

I've been trying to refactor a brand new project to follow the hexagonal architecture and ddd patterns. This is the structure of my domain. I have files and customer data. Entity wise this makes sense to be separated. The "facade" objects connect…