Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 architecture without using additional framework? Most of the time SPI's implementations will be reactive (API's implementations/adaptations also) and the core of the business layer should also be reactive.

Is there any JSR (implemented by each reactive framework) to use? Or should I define my own and perform adaptations with the final framework I will use in infra part?

like image 807
OlivierTerrien Avatar asked Nov 23 '25 19:11

OlivierTerrien


1 Answers

I've never developed software following a reactive programming approach, I don't know much about it... but I know it is a programming paradigm, so it defines the way you have to write source code, how you have to structure it, etc.

From my point of view, RxJava wouldn't be considered as a framework, in the sense of technology that you use to communicate with the actors living outside your application. RxJava would be an extension to a programming language (Java) that lacks the chance of writing reactive code with it.

So I see no problem using RxJava to write the hexagon source code.

like image 146
choquero70 Avatar answered Nov 26 '25 18:11

choquero70



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!