1
votes

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?

1
When you say reactive framework I assume you mean library (like RxJava or Reactor). That would also answer your question. - a better oliver
Yes, I mean RxJava or Reactor. But that does not answer to my question. If I use one of these framework, I am not compatible with the other. That is especially the problem. Morevor, as far as I know, it shouldn't be possible to create any hexagon with a dedicated framework otherwise this hexagon is stronly linked to this framework and cannot be used in another way. - OlivierTerrien
A library is not a framework. And yes, Java 9 provides a set of standard interfaces. Even without them: the core defines the contract. If an adapter uses a different library, so be it! - a better oliver

1 Answers

1
votes

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.