Simple inversion of control structure for Java / Scala

I am looking for an easy-to-use IoC container for graphical applications written in Java / Scala.

It should support the Convention on configuration, life cycle management, code customization (preferably without any XML code at all), and check dependencies at compile time as much as possible. Something like Autofac would be perfect.

+5
source share
4 answers

It sounds like you need something like Google Guice .

Java IoC (, PicoContainer), Spring . , Spring, , .

Guice .

+12
+5

Google Guice :

http://code.google.com/p/google-guice/

XML-, , , (TransactionLog) (DatabaseTransactionLog):

public class BillingModule extends AbstractModule {
  @Override 
  protected void configure() {
    bind(TransactionLog.class).to(DatabaseTransactionLog.class);
  }
}
+3

PicoContainer is a highly embedded container with a full set of Inversion of Control (IoC) functions for components whose character is a dependency dependency pattern. The project began in 2003 and initiated the automatic wiring of the designer. It is also open source and therefore free to use. The license is BSD and you can safely use it with commercial or other open source software.

+1
source

All Articles