What is the difference between an EventAggregator and an EventBinder in a basic puppet?

From the documents in Marionette.EventAggregator and Marionette.EventBinder, the code is exactly the same. I guess there is a difference that I am missing, what is it? When to use each of them?

+4
source share
1 answer

The main difference was intention. These articles explain the purpose of 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/

The purpose of EventBinder was to manage dependencies in event bindings, as described first by Johnny Oshika: Backbone.js: repeat or recreate a view?

...

Moving forward with Marionette and Backbone v0.9.9, however, EventBinder is now deprecated since Backbone.Events now includes listenTo and stopListening . EventAggregator takes care of everything that Backbone.Events does not cover. This is for Marionette v1.0-rc3 and higher. If you are still using Marionette v1.0-rc2 or the previous one, you will still need an EventBinder.

+5
source

All Articles