Dependency injection in IDEA plugins
Answered
Is there a way to use a full set of PicoContainer features out-of-the-box ("component-service model") ? i.e. custom contexts with manually defined parent-child hierarchy, injection via Provider classes and so on.
Please sign in to leave a comment.
No. Consider to use IJ Platform Services and Extensions.
Okay, got it. Btw, can you clarify another thing too? Can I have multiple implementations of some service's interface and decide what implementation to inject in the point of injection? Something like a @Qualifier annotation in Spring.
What is the use case for having multiple implementations? You can distinguish between production (serviceImplementation), headless (headlessImplementation) and test (testServiceImplementation) by specifying according implementation in plugin.xml.