I am looking for a simple to use IoC container for GUI applications written in Java/Scala.
It should support Convention over Configuration, lifecycle management, configuration in code (preferably without any XML needed at all), and checking dependencies at compile-time as much as possible. Something similar to Autofac would be perfect.
The name “Inversion of Control” means that instead of you, the framework will be behind the steering wheel of the execution flow of your program, and that helps in decoupling the execution from the implementation, facilitating changes of different implemented code, modularization of the program and for last but not ...
Inversion of control is a software design principle that asserts a program can benefit in terms of pluggability, testability, usability and loose coupling if the management of an application's flow is transferred to a different part of the application.
Dependency injection is a widely used design pattern that helps separate your components' behaviour from dependency resolution. Play supports both runtime dependency injection based on JSR 330 (described in this page) and compile time dependency injection in Scala.
Dependency Injection is the method of providing the dependencies and Inversion of Control is the end result of Dependency Injection. IoC is a design principle where the control flow of the program is inverted. Dependency Injection is one of the subtypes of the IOC principle.
Sounds like you need something like Google Guice.
There used to quite a few IoC containers for Java (e.g. PicoContainer), but they've all been in the shadow of Spring for years now. Spring is likely a bit over the top for your needs, though.
Guice has restarted some healthy competition.
If you are going pure Scala, you can take a look at Sindi: http://aloiscochard.github.com/sindi
Note: I'm the Sindi project author
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