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

Calling repository from domain with interface Hexagonal Architecture

I need to know if an entity (User) matches given some criteria. I have defined the criterions in the domain and they implements an interface: match(User)bool Now the problem is one criterion needs the data of the other entity (Company), and User…
0
votes
1 answer

How to handle relationships in domain when they are part of the database normalization

You have Job *--1 Board, so in your database you will have a board_id in your jobs table. Now, in the domain, Job can live without Board. So thinking about adding a boardId property to it doesn't seam logical to me. Is it ok to manage it through the…
0
votes
1 answer

Which one of these two options is the best for implementing a port in the domain

I have a Document class which needs to be authorized externally before being saved to database. Is it ok to create an authorize method like ... class Document: authorize(IExternalAuthorizator authorizator): authorization_result =…
0
votes
2 answers

Where is the best layer (Presentation, Service, Domain, Repository) to set a image path url

I have a question for you. I have a .NetCore proyect with a hexagonal architecture. In my repository class I fill my domain class that its name is company and has two properties: Id and Logo. My repository returns de Id and the logo name, but not…
0
votes
1 answer

Confused on how to write a simulator

I am trying to follow the hexagonal design of ports and adapters and more specifically following this approach: https://docs.microsoft.com/en-us/archive/blogs/ericgu/unit-test-success-using-ports-adapters-simulatorskata-walkthrough and…
user2820906
  • 127
  • 9
0
votes
1 answer

Complex multi module maven project failed to build

I stuck on building complex maven multi module project based on Hexagonal architecture. My maven module structure look like that | graphql-intro (root module) | graphql-intro.xml +-- bootloader (module) | +---…
Sebastian
  • 72
  • 11
0
votes
1 answer

Hexagonal architecture with api-platform

I'm going to create an api with api-platform and I want to separate my business logic from framework. For example I want to allow users to register new accounts and POST: /user is good for that. Api-platform is doing all the magic (handler request,…
d0niek
  • 173
  • 11
0
votes
1 answer

DDD - java 9 modules project ogranization

I'm trying to organize DDD project using hexagonal architecture in java 9 (using maven modules). Is there anywhere working example that is already being used in productions systems? So, far I have only some idea how to do this: Here I have domain…
0
votes
1 answer

Hexagonal Architecture / Ports & Adapters: Application Configuration with multiple driver adapters

I'm look for some guidance or best practise for how to configure and structure an Application which conforms to Hexagonal architecture that supports multiple (driver) adapters simultaneously. My API / Application Layer / Ports represent the…
0
votes
3 answers

Change entity status depending on datetime value

I have a Subscription entity that has status and canceledAt fields. I want status to change from active to canceled when canceledAt has expired. So, I imagine checking canceledAt in Subscription::getStatus method: // Subscription.php public…
jerkan
  • 560
  • 2
  • 10
  • 25
0
votes
1 answer

Where should I put a class result in DDD?

Given a ReceiptValidator interface and a GoogleReceiptValidator implementation that returns several data, where should I put a ReceiptValidatorResult? Since it's related to ReceiptValidator, it could be placed in the Domain Layer. But, what if…
jerkan
  • 560
  • 2
  • 10
  • 25
0
votes
1 answer

How do I design a model with generated ID

I have a project in which I use some domain models. The ID for those models is deterministic and depends only on the content of the object. Two property-wise identical objects will have the same ID. This is true for any object of my model. This…
Ephasme
  • 212
  • 1
  • 9
0
votes
1 answer

Visitor on a business object in the domain in hexagonal/onion architecture?

I'm using hexagonal architecture and I wonder how a visitor pattern would respect it ? The visited object is a domain object, but the visitor aims to dynamically dispatch said domain object implementations to appropriate mappers between domain…
0
votes
1 answer

Did I understand Ports & Adapters/Hexagonal architecture correctly?

The Ports and Adapters architecture aims at building decoupled code. The Domain layer does not depend on the Infrastructure layer directly, instead it depends on the port (the interface) and the implementation of the port is in the Infrastructure…
57913
  • 583
  • 1
  • 4
  • 10
0
votes
1 answer

Onion architecture - Can everyone layer access every interface (breaking the layer dependencies)?

I've been studying and implementing the pattern refered to as Onion Architecture (http://jeffreypalermo.com/blog/the-onion-architecture-part-3/). One thing that makes me question if I understand correctly is the following: All interfaces are defined…