In Java 6, they introduced SPI (service provider interface). It helped to instantiate an object that implements a certain interface, without knowing its exact class, but it only did so for raw types.
However, with SPI, I cannot instantiate parameterized classes like Class<A,B>
that implements SomeInterface<A,B>
.
How do I do that if I don't want to use any dependency framework like Spring or CDI, in order to keep my library agnostic of those DI frameworks?
Seems like I painted myself into a corner.