-
Notifications
You must be signed in to change notification settings - Fork 0
DependencyInjection
Michal Durdina edited this page Jan 20, 2015
·
1 revision
The aim of this article is to provide overview of capabilities and also differences between various dependency injection containers. To save space there will be no introduction to neither dependency injection not to any of the containers discussed. So let's start.
All of the containers nowadays use Java based configuration. This style benefits from type checking and lot of expressivity that allows less boilerplate.
Typical Java Based configuration in Guice:
public class SomeModule extends AbstractModule {
public void configure() {
bind(SomeInterface.class).to(SomeImplementation.class).in(Scopes.SINGLETON);
}
@Provides
SomeOtherInterface myFactory() {
return new SomeOtherImplementation();
};
}