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
1 answer

DDD Repository vs Factory, Am I rehydrating or creating?

We have an externally-owned SQL server with data that needs to be in our periodically ported into our team-owned (SQL) server. The external and internal server share the same domain concepts but exist in very distinct forms. Transforming the object…
2
votes
1 answer

How to return a Flux in async/reactive webclient request with subscribe method

I am using spring hexagonal architecture (port and adapter) as my application need to read the stream of data from the source topic, process/transforms the data, and send it to destination topic. My application need to do the following…
2
votes
0 answers

Hexagonal architecture: how to avoid mixing concepts and leaking infrastructure details into domain

Background I'm designing a simple app that lets users sign in via an external OAuth service, and add products to their account, rename them or remove them from their account. There are two outgoing ports: a user account service which handles login,…
Prashant
  • 53
  • 4
2
votes
1 answer

Qualcomm DSP: hexagon-sim with command line arguments

I am profiling c code on a hexagon simulator with the following tool: Qualcomm/Hexagon_SDK/3.5.3/tools/HEXAGON_Tools/8.3.07/Tools/bin/hexagon-sim --timing --profile binary.hexagon The binary is built with the…
2
votes
1 answer

Hexagonal architecture and DDD

I have a question reagarding regarding hexagonal architecture and DDD Is it allowed to call domain logic from persistence adapter which is passed to adapter as an argument? Example: class DomainService(private val repositoryPort: RepositoryPort, …
luki27
  • 31
  • 1
  • 4
2
votes
2 answers

Application Events in DDD?

This question is similar to: Does exist application event term in DDD? , but I don't know how to apply the explanations given there to my specific issue. I have a SearchFilmUseCase and I want to raise an event FilmSearchedEvent once it finishes its…
2
votes
1 answer

Design of a service dependent on SOAP API which changes a lot

I'm refactoring a service which is dependent on a SOAP service. Unfortunately the SOAP service changes regularly. My service uses classes generated from SOAP's wsdl document. There is no layer that would separate entities defined in the SOAP service…
2
votes
2 answers

How InboundPorts in the Hexagonal increase testability

In Ports and Adapters (Hexagonal) Architecture you have: DrivingAdapter -> InboundPort <- [ domain ] -> OutboundPort <- DrivenAdapter note: of course the ports are part of the domain A concrete example of this could be: WebController ->…
jakstack
  • 2,143
  • 3
  • 20
  • 37
2
votes
0 answers

Using hexagonal architecture in embedded systems

I'm trying to work out how the hexagonal (ports and adapters) architecture might be used in the context of an embedded software system. if I understand right, the architecture is something like this. /-----------------\ …
Dushara
  • 616
  • 1
  • 5
  • 25
2
votes
1 answer

Hexagonal Architecture: How to implement driver ports

I am looking into using the ports and adapters pattern with layered architecture. So I'll have the following layers: framework/Infrastructure - i.e. ASP.NET MVC, Entity Framework, SMTP Client application - logic that pulls your application together…
Ian Kirkpatrick
  • 1,861
  • 14
  • 33
2
votes
1 answer

where exaclty ports should be implemented?

In DDD implementation with Hexagonal Architecture the application might have ports (interfaces) and adapters (clients) .In my current project I am implementing Event driven based micorservices .I have a domain application service layer and and…
2
votes
2 answers

How to prevent certain packages from using spring with ArchUnit?

If I wanted to keep a certain Java package free of 3rd party dependencies with ArchUnit, how would I do it? More specifically I am looking at keeping my domain model in a hexagonal architecture free from spring code. I specified some rules which I…
2
votes
2 answers

Work with dto's to build an API with DDD

I'm starting to work with dto's (data transfer objects) and I have some doubts about the best way to build the system architecture of the API. Imagine a domain entity 'A', with relations to 'B', 'C' and 'D'. We have a service 'S' that return a json…
2
votes
2 answers

Hexagonal architecture with repository

I am trying to understand hexagonal architecture through an example of Repository. In this setup I have the following layers: framework (infrastructure) -> application -> domain. I have User in the domain part, lets say I want to validate the User…
Albert Bos
  • 2,012
  • 1
  • 15
  • 26
2
votes
2 answers

Is there an easy way to define a common interface for a group of unrelated objects?

I've got a class that serializes data. I may want to serialize this data as JSON, or perhaps YAML. Can I cleanly swap YAML for JSON objects in this case? I was hoping I could do something like the following. Is it a pipe dream? FORMATS = { :json…
Blaine Lafreniere
  • 3,451
  • 6
  • 33
  • 55