Tiny Dependency Injection Framework for picocli
This project is currently in early stage of development.
You can add picodi as an external dependency to your project.
compile 'io.restall.picodi:picodi:0.0.5'
<dependency>
<groupId>io.restall.picodi</groupId>
<artifactId>picodi</artifactId>
<version>0.0.5</version>
</dependency>
Picodi is designed to be simple to use and only supports constructor injection.
Firstly create a new instance of Picodi then classes and instances should be registered with that instance. Finally a IFactory can be created from Picodi.
public static void main(String[] args) {
CommandLine.run(new Example(), args);
}
See picodi-example for a more detailed example.
A few features have been deliberately excluded. If you need these features we suggest you use a heavier library like Guice or Spring.
- Classpath scanning
- Dependency naming