I've download Guice 2.0 and 3.0 via Maven, and can't find the entire com.google.inject.assistedinject package in the jar. All the other components of Guice seem to be there, but Assisted and its brethren are simply not there.
Any idea where they went?
An assisted injection is a dependency injection (DI) pattern that is used to construct an object where some parameters may be provided by the DI framework and others must be passed in, at creation time (a.k.a “assisted”), by the developer (you).
Providers are used in numerous ways by Guice: When the default means for obtaining instances (an injectable or parameterless constructor) is insufficient for a particular binding, the module can specify a custom Provider instead, to control exactly how Guice creates or obtains instances for the binding.
an easier way to get Guice to build auto-wired factories. Factories are a well established pattern for creating value objects, model/domain objects (entities), or objects that combine parameterization and dependencies. Factories can be brittle and contain a lot of boilerplate.
Assisted is bundled with the rest of the AssistedInjection extension as a separate artifact in the com.google.inject.extensions group, along with Multibindings, Persistence and Servlet.
4.0 is com.google.inject.extensions:guice-assistedinject:4.0
3.0 is com.google.inject.extensions:guice-assistedinject:3.0
2.0 is com.google.inject.extensions:guice-assisted-inject:2.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With