2012-12-28 42 views

回答

5

主要区别是意图。一个EventAggregator的意图是在这些文章中解释说:

http://martinfowler.com/eaaDev/EventAggregator.html

http://codebetter.com/jeremymiller/2009/07/22/braindump-on-the-event-aggregator-pattern/

http://lostechies.com/derickbailey/2011/07/19/references-routing-and-the-event-aggregator-coordinating-views-in-backbone-js/

的EventBinder的目的是为了管理事件绑定的依赖,首先由约翰尼大鹿说明如下:Backbone.js : repopulate or recreate the view?

...

尽管Marionette和Backbone v0.9.9继续前进,但EventBinder现在已经过时,因为Backbone.Events现在包含listenTostopListening方法。 EventAggregator接管Backbone.Events不包括的任何东西。不过,这是针对Marionette v1.0-rc3及更高版本的。如果您仍在使用Marionette v1.0-rc2或之前的版本,则仍然需要EventBinder。

+0

我不知道这个事件在0.9.9上的增加,所以对于好消息+1。 –

相关问题