|
|
1
20
您仍然可以累积回调列表,但是您可以使它们成为函数,而不必再提出另一个方法接口。 例如
this somewhat-related paper 如果你想吃红色药丸。:) |
|
|
2
18
对。读报纸 Deprecating the Observer Pattern 作者:Ingo Maier、Tiark Rompf和Martin Odersky。 更新27-Apt-2015: Deprecating the Observer Pattern with Scala.React 作者:梅尔和奥德斯基。 |
|
|
3
4
http://blog.objectmentor.com/articles/2008/08/03/the-seductions-of-scala-part-i 这使用了Scala的一些特性,比如用[S]表示的泛型,类似于Java接口但功能更强大的traits,::在观察器列表中预先添加一个观察器,以及一个foreach,其参数使用一个来计算当前观察器。 |
|
|
4
2
你可以用scala.collection.mutable变量.Publisher和scala.collection.mutable变量.Subscriber创建发布/订阅实现 |