Skip to content

Commit b6519c6

Browse files
author
Fabian Baumeister
committed
fix: Review and align with SEAguide
Added review fixes. Renamed all outbound to outgoing and all inbound to incoming (according to SEAguide)
1 parent 09079c5 commit b6519c6

1 file changed

Lines changed: 18 additions & 21 deletions

File tree

modules/ROOT/pages/architecture/hexagonale_architecture.adoc

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ image::hexagonal_component_architecture_overview.drawio.svg["devonfw hexagonal a
1313
// As the list is easier to maintain, try to do edits in the list structure, use the tool mentioned above and paste both in here:
1414

1515
// - application
16-
// - config
17-
// - Configuration.java
1816
// - core
1917
// - domain
2018
// - Customer.java
@@ -59,8 +57,6 @@ image::hexagonal_component_architecture_overview.drawio.svg["devonfw hexagonal a
5957
----
6058
.
6159
└── application/
62-
├── config/
63-
│ └── Configuration.java
6460
├── core/
6561
│ ├── domain/
6662
│ │ ├── Customer.java
@@ -108,7 +104,7 @@ image::hexagonal_component_architecture_overview.drawio.svg["devonfw hexagonal a
108104
| The core contains the essential business logic, domain entities, and use cases. It focuses on implementing the main functionalities while remaining technology-agnostic. The core interacts with external components through well-defined interfaces called "ports," ensuring a clear separation of concerns and promoting flexibility, testability, and maintainability.
109105

110106
| core.domain
111-
| The domain circle contains the entities and value objects of the business domain of the application.
107+
| The domain package contains the entities and value objects of the business domain of the application.
112108
Related Factories or Builders are located here as well.
113109
It's proposed to make entities anemic. See <<_anemic_vs_rich_domain_models>>
114110

@@ -122,30 +118,30 @@ Depending of the size and adjacency of the use cases a grouping might make sense
122118
| Ports are interfaces, that are used by the core and should be implemented by an according adapter.
123119
Ports should not be technology specific.
124120
One big advantage of the hexagonal architecture is, that the adapters can be changed without changing the core and therefore, without touching the business logic.
125-
It needs to be distinguished between inbound ports and outbound ports.
121+
It needs to be distinguished between incoming ports and outgoing ports.
126122

127123
| core.port.in
128-
| Inbound ports are the entry of the application.
129-
They provide interfaces that are called from inbound adapters and hide the actual implementation.
130-
A proposal of structuring inbound ports is naming them like single use cases (e.g. CancelReservationPort).
124+
| Incoming ports are the entry of the application.
125+
They provide interfaces that are called from incoming adapters and hide the actual implementation.
126+
A proposal of structuring incoming ports is naming them like single use cases (e.g. CancelReservationPort).
131127
Each port should only provide a single method.
132128
.Design Decision
133129
[%collapsible]
134130
====
135-
Inbound Ports are not as relevant for the hexagonal architecture as the outbound ports.
136-
Outbound ports are used for the dependency inversion pattern.
137-
For inbound ports could also call the use cases directly.
138-
Therefore, an pragmatic alternative would be leaving out the inbound ports.
131+
Incoming Ports are not as relevant for the hexagonal architecture as the outgoing ports.
132+
Outgoing ports are used for the dependency inversion pattern.
133+
For incoming ports could also call the use cases directly.
134+
Therefore, an pragmatic alternative would be leaving out the incoming ports.
139135

140-
It was decided to include the inbound ports nonetheless. They should implement single use cases that are offered.
136+
It was decided to include the incoming ports nonetheless. They should implement single use cases that are offered.
141137
Each interface should clearly mark the use case that contains only one method.
142138
Use cases from the interface might be grouped logically in the use case implementation class.
143139
====
144140

145141
| core.port.out
146-
| Outbound ports decouple the interaction with external systems.
142+
| Outgoing ports are an abstraction of everything in the surrounding context that is actively triggered by the core or used as data sink.
147143
This might include other services that are called, files that are written, databases, event streaming and everything the application is actively triggering outside of the core.
148-
Outbound ports should describe the business need for the communication (e.g. StoreReservationPort). How this is then realized depends on the adapter that implements it.
144+
Outgoing ports should describe the business need for the communication (e.g. StoreReservationPort). How this is then realized depends on the adapter that implements it.
149145
This way a technology can be easily replaced.
150146
For example storing the reservation could be be realized in a first prototype by writing the objects to a file.
151147
Later it could be replaced with a database.
@@ -154,7 +150,8 @@ The core logic would be untouched by that.
154150
| [optional] core.service
155151
| Services can be considered as business helper classes.
156152
They provide a reusable part of the applications business logic that is used by multiple use cases or that helps to structure the application in a logical way.
157-
Services are optional as they can be used, when there's a real need. Usually a use case should contain the business logic.
153+
Services are optional as they can be used, when there's a real need.
154+
Usually a use case should contain the business logic.
158155

159156
| adapter
160157
a| Adapters connect the application core to the surrounding context. They have the following tasks:
@@ -166,14 +163,14 @@ a| Adapters connect the application core to the surrounding context. They have t
166163
* Log the interaction with the surrounding context
167164
168165
| adapter.in
169-
| Inbound adapters specify connection points for everything that can trigger the business logic.
166+
| Incoming adapters specify connection points for everything that can trigger the business logic.
170167
That might be interfaces (HTML, RPC, etc), Message Consumers or schedulers for batch processing.
171-
Inside the adapters further packages are differentiating the protocols that is used (e.g. `.rest`).
168+
Inside the adapters further packages are differentiating the category of the adapter (e.g. `.web`).
172169

173170
| adapter.out
174-
| Outbound adapters define outgoing connections where the application actively interacts with context outside.
171+
| Outgoing adapters define outgoing connections where the application actively interacts with context outside.
175172
That can be database connections, file operations, API calls, message producing and many more.
176-
Inside the adapters further packages are differentiating the protocols that is used (e.g. `.jpa`).
173+
Inside the adapters further packages are differentiating the category of the adapter (e.g. `.repository`).
177174
|===
178175

179176

0 commit comments

Comments
 (0)