<div dir="auto"><div dir="auto">Reason/Background:</div>I was building a server application (in java) designed around the mediator pattern and dependency injection inspired by a c# server application tutorial. So I was researching but every dependency injection framework was relying on bytecode manipulation to do the injection.<div dir="auto">For background I really dislike bytecode manipulation for production code. </div><div dir="auto">So I researched what the jdk provides and what not. I discovered that the jdk provides service loading capabilities in form of the ServiceLoader api. But it is pretty barebones only allowing creation of service implementations providing a no-args constructor.</div><div dir="auto"><br></div><div dir="auto">Idea:</div><div dir="auto">I thought that this could be expanded to allow loading of services that depend on other services (In form of constructor parameters) that can be loaded with associated ServiceLoaders. </div><div dir="auto">So I coded a small test wrapper for ServiceLoader that does the injection of known services. </div><div dir="auto">I used MethodHandles to create factory handles that use the associated loaders to fill in the constructor and in that way avoided bytecode manipulation.</div><div dir="auto"><br></div><div dir="auto">Suggestion:</div><div dir="auto">I was wondering if this concept would be interesting to incorporate into the jdk as an expansion of the ServiceLoader api.</div><div dir="auto"><br></div><div dir="auto">Great regards </div><div dir="auto">RedIODev </div></div>