Dependency Injection

Kasper Nielsen kasperni at gmail.com
Mon Feb 20 19:57:20 UTC 2023


> Suggestion:
> I was wondering if this concept would be interesting to incorporate into the jdk as an expansion of the ServiceLoader api.
>

I think the practical use cases for this are going to be very limited.
ServiceLoader always creates a new service per request. So if both B and C
depend on A. Two instances of A will be created. Which is rarely what
you want when you are composing an application.

/Kasper


More information about the amber-dev mailing list