import scaldi.Injectable;
import scaldi.Module;
import scaldi.Injector;
class MyApp {
@Injectable
static class MyService {
public void doSomething() {
System.out.println("Doing something...");
}
}
static class MyModule extends Module {
bind[MyService] to new MyService
}
public static void main(String[] args) {
Injector.injector = new MyModule :: new
val myService = inject[MyService]
myService.doSomething()
}
}