import wvlet.airframe._ trait Service { def hello: String } class MyService extends Service { def hello = "Hello, Airframe!" } class MyApp(service: Service) { def start() = { println(service.hello) } } object Main { def main(args: Array[String]) = { val d = newDesign .bind[Service].to[MyService] .bind[MyApp] d.build[MyApp] { app => app.start() } } }


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