Injectables - GeoscienceAustralia/earthsci GitHub Wiki

One of the biggest advantages of the Eclipse 4 Application Platform (E4AP) is the dependency injection mechanism it uses. This allows for good modularity and low coupling between plugins.

The au.gov.ga.earthsci.injectable plugin contains the au.gov.ga.earthsci.injectables extension point which allows plugins to define classes that will be instantiated and then injected with (and optionally injected into) the application's Eclipse context.

The injectable element defines a class that will be instantiated and then injected with the Eclipse context. The inject element is the same, but it also gets injected into the context, which makes the object available to other classes for injection. The bind element simply binds an implementation class to an interface/class such that, when the interface/class is marked to be injected, an instance of the implementation class is injected.