// Maven <dependency> <groupId>org.scaldi</groupId> <artifactId>scaldi</artifactId> <version>0.5.8</version> </dependency> // Gradle implementation 'org.scaldi:scaldi:0.5.8' import org.scaldi.InjectableModule; public class MyModule extends InjectableModule { protected void configure() { bind[MyService] to new MyServiceImpl } } import org.scaldi.Injectable public class Application { public static void main(String[] args) { Injectable.inject[MyModule] val myService = Injectable.inject[MyService] myService.doSomething() } }


上一篇:
下一篇:
切换中文