Essentials Dependency injection

In a Seed application, the dependency injection is provided by a Guice injector, created by the kernel in its starting phase. The injector is configured in explicit mode, meaning that all the application injection points are checked during application startup and must be resolvable. This mode ensures that injection errors are detected as soon as possible in the development process. Although Guice is operating behind the scenes, it is invisible for the application which only needs to rely on JSR 330 annotations for defining injection points.

Manual Qualified injection

With the business framework, much like the rest of SeedStack, you declare injection points with an interface type not an implementation one. The framework discovers any implementation of a specific interface and will inject it through its interface. For a specific interface, the business framework supports multiple implementations. This is particularly useful when you have multiple algorithms of implementation technologies for an interface. If multiple implementations of a specific interface are found, you must use a qualifier on each one to differentiate them.

Spring bridge

SeedStack Spring bridge add-on is a bi-directional injection bridge between SeedStack (Guice) and Spring. It allows to inject Spring beans with Guice and vice-versa.

3 element(s)

Filter