Scala Listener/Observer

后端 未结 4 1249
庸人自扰
庸人自扰 2020-12-28 19:52

Typically, in Java, when I\'ve got an object who\'s providing some sort of notification to other objects, I\'ll employ the Listener/Observer pattern.

Is there a mor

4条回答
  •  醉话见心
    2020-12-28 20:14

    Is there a more Scala-like way to do this?

    Yes. Read the paper Deprecating the Observer Pattern by Ingo Maier, Tiark Rompf, and Martin Odersky.

    Update 27-Apt-2015: There is also a more recent Deprecating the Observer Pattern with Scala.React by Maier and Odersky.

提交回复
热议问题