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.

95 questions
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
  • 2,584
  • 23
  • 41
2
votes
2 answers

Where to apply domain level permissioning

Permissioning/Authorization (not Authentication) is a cross-cutting concern, I think. In an Onion Architecture or Hexagonal Architecture, where should permissioning be performed? Examples of permissioning required would be: Filtering data returned…
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
1 answer

Need help improving a design with aggregate roots

I have the follow scenario: You need to create a Request before it to become a Shop and to get a Owner Account. So one day you register a Request. 2 days after a manager reviews and approves your Request and it means that the system have to create…
1
vote
2 answers

Layers in Hexagonal Architecture

I'm reading a lot about hexagonal architecture, but in all the examples that i'm looking, all folders and class ubication are different, and this looks a bit confusing to me. I've done a simple spring boot application with below folder structure.…
1
vote
1 answer

Jpa Entity as Domain Model

As per recommended practices documented for DDD or Hexagonal architecture - Domain Model should be separate from the data model representations that is more tied with actual technology used( table/column names , joins etc , jpa annotation) .A…
1
vote
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…
1
vote
1 answer

Domain Driven Design and Hexagonal Architecture

recently I was learning about DDD. I also have some experience with Hexagonal architectures(also know as ports and adapters). I want to put my leanings into practice and create a trading app. At first I wan't to have an monolithic application with…
1
vote
2 answers

Spring Data - hibernate.cfg.xml in different package

I'm new to Spring, and trying to create a hexagonal architecture with spring data I have a gradle multi-module setup with on package for the domain, one for persistence, and another for configuration, where the DddApplication lives. When starting…
1
vote
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
  • 1,926
  • 3
  • 18
  • 31
1
vote
1 answer

Single queries or JOINs on MySQL (plus Redis) implementation for Hexagonal Architecture

I’m developing a NodeJS project with hexagonal architecture but I have a big doubt about how to manage the workflow in implementations of databases (MySQL & Redis) MySQL implementation: I’m using Sequelize ORM & it’s possible to populate models to…
1
vote
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,553
  • 7
  • 23
1
vote
1 answer

How to do reactive hexagonal architecture

I always heard hexagonal architecture has to be agnostic of any framework and use interfaces (SPI) to delegate each part of code which does not belong to the business layer. But how to create a reactive business layer thanks to hexagonal…
OlivierTerrien
  • 1,911
  • 16
  • 28
1
vote
1 answer

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

Database repository dependencies in Hexagonal Architecture

i'm migrating a nTier architecture into an hexagonal one. My domain is well defined now, and I have interfaces for all infrastructure dependencies. Looking at database repositories, I have several databases and there is one class implementing each…
user810917
  • 221
  • 4
  • 11