grrolland / ngx-distributed-shm

Distributed SHM storage based on Hazelcast for NGinx.
GNU General Public License v3.0
18 stars 6 forks source link

DI integration #34

Open alexist opened 9 months ago

alexist commented 9 months ago

Hi, Currently, there is no dependency injection, dependencies are instanciates in classes who needs them. The main drawback : writing unit test is not easy, you will need PowerMock, mock constructor call, and maybe mock static method too

Integrating a minimalist DI framework can solve this.

This article talk about Micronaut DI integration with vertx : https://taraskohut.medium.com/vert-x-micronaut-do-we-need-dependency-injection-in-the-microservices-world-84e43b3b228e

grrolland commented 9 months ago

Hi,

You are right, it's perhaps time to inject depedencies !!

I try Micronaut DI on antoher project. It seems good for the purpose here. You can try version 3.10.3, the last compatible with Java 1.8, if you have some time to spend on this !!