FAQ
*Dear all,*

*There are many way wire dependencies in Scala, *

*does anyone have best practice for each? and are there more wire ways?*

*
*

*examples: trait A {def foo = ???}*

*class trait parameter, Class C(a: A)*

*class pure function parameters, Class C(f: String => String)*

*function trait parameter, def foo(a: A)*

*function implicit trait parameter**, def foo(implicit a: CanBuild)*

*function lambda parameter,** **def foo(f: String => String)*

*mixin trait, Class C extends A*

*import object and call directly, Class C {def bar = o.foo }*

*cake pattern, ...*

*guice/spring ioc annotation, ...*

--

吴雪峰/ Alan 敬上

--
您收到此邮件是因为您订阅了 Google 网上论坛的“Scala中文社区”论坛。
要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到 scalacn+unsubscribe@googlegroups.com
要向此网上论坛发帖,请发送电子邮件至 scalacn@googlegroups.com
要查看更多选项,请访问 https://groups.google.com/groups/opt_out。

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupscalacn @
postedAug 13, '13 at 3:11a
activeAug 13, '13 at 3:11a
posts1
users1

1 user in discussion

Xuefeng Wu: 1 post

People

Translate

site design / logo © 2019 Grokbase