<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Revisiting The Backbone Event Aggregator: Lessons Learned</title>
	<atom:link href="http://lostechies.com/derickbailey/2012/04/03/revisiting-the-backbone-event-aggregator-lessons-learned/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/derickbailey/2012/04/03/revisiting-the-backbone-event-aggregator-lessons-learned/</link>
	<description>Better Than Yesterday</description>
	<lastBuildDate>Fri, 24 May 2013 06:39:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: Erich Schulz</title>
		<link>http://lostechies.com/derickbailey/2012/04/03/revisiting-the-backbone-event-aggregator-lessons-learned/#comment-3202</link>
		<dc:creator>Erich Schulz</dc:creator>
		<pubDate>Fri, 26 Apr 2013 02:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=863#comment-3202</guid>
		<description>For utter noobs like me trying to figure out how to pass parameters to events: just put them as second parameter in your trigger call.</description>
		<content:encoded><![CDATA[<p>For utter noobs like me trying to figure out how to pass parameters to events: just put them as second parameter in your trigger call.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evan Hobbs</title>
		<link>http://lostechies.com/derickbailey/2012/04/03/revisiting-the-backbone-event-aggregator-lessons-learned/#comment-3067</link>
		<dc:creator>Evan Hobbs</dc:creator>
		<pubDate>Wed, 20 Feb 2013 18:04:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=863#comment-3067</guid>
		<description>This has become one of the most useful Backbone patterns I&#039;ve learned. Thanks! Before I was using all kinds of weird logic to maintain seperation concerns while still allowing communication between objects. One thing I&#039;d point out is the event object is already added to the Backbone object for just this purpose. It&#039;s not in the docs but it&#039;s in the code for backbone.js:

 // Allow the `Backbone` object to serve as a global event bus, for folks who
  // want global &quot;pubsub&quot; in a convenient place.
  _.extend(Backbone, Events);

So for smaller apps you can just call Backbone.on(&#039;event&#039;) and Backbone.trigger(&#039;event&#039;) without needing to pass around the &#039;Vent&#039;</description>
		<content:encoded><![CDATA[<p>This has become one of the most useful Backbone patterns I&#8217;ve learned. Thanks! Before I was using all kinds of weird logic to maintain seperation concerns while still allowing communication between objects. One thing I&#8217;d point out is the event object is already added to the Backbone object for just this purpose. It&#8217;s not in the docs but it&#8217;s in the code for backbone.js:</p>
<p> // Allow the `Backbone` object to serve as a global event bus, for folks who<br />
  // want global &#8220;pubsub&#8221; in a convenient place.<br />
  _.extend(Backbone, Events);</p>
<p>So for smaller apps you can just call Backbone.on(&#8216;event&#8217;) and Backbone.trigger(&#8216;event&#8217;) without needing to pass around the &#8216;Vent&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mxdubois</title>
		<link>http://lostechies.com/derickbailey/2012/04/03/revisiting-the-backbone-event-aggregator-lessons-learned/#comment-2971</link>
		<dc:creator>mxdubois</dc:creator>
		<pubDate>Tue, 08 Jan 2013 23:43:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=863#comment-2971</guid>
		<description>Your article inspired me to put together a little factory method for creating/getting namespaced event channels on the fly. You can check it out here: https://github.com/mxdubois/backbone-event-channels</description>
		<content:encoded><![CDATA[<p>Your article inspired me to put together a little factory method for creating/getting namespaced event channels on the fly. You can check it out here: <a href="https://github.com/mxdubois/backbone-event-channels" rel="nofollow">https://github.com/mxdubois/backbone-event-channels</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Cipriano</title>
		<link>http://lostechies.com/derickbailey/2012/04/03/revisiting-the-backbone-event-aggregator-lessons-learned/#comment-2946</link>
		<dc:creator>Jonathan Cipriano</dc:creator>
		<pubDate>Fri, 21 Dec 2012 20:31:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=863#comment-2946</guid>
		<description>Nice post. First time to your blog. I don&#039;t use Marionette, but I&#039;ll have to check it out.

I&#039;ve been toying with the idea of extending backbone to include automated dependency injection, but could not convince myself of the advantages. Like you, I was referring to my experience in C# (WPF) as well as Actionscript (Flash). 

Currently I use the approach you describe here by attaching an event bus to the application namespace. I do the same with a model that needs to be accessed from multiple areas of the app. It &quot;feels&quot; bad to do, but after reading your post I&#039;m somewhat convinced to stick with it. Anything else seems to overcomplicate things as it tries to deal with hurdles that just do not exist in Javascript.

Some posts below mention that this approach could lead to a &quot;dumping ground&quot;. Totally true, but Javascript itself is one huge dumping ground already. It&#039;s really up to the developers to discipline themselves.</description>
		<content:encoded><![CDATA[<p>Nice post. First time to your blog. I don&#8217;t use Marionette, but I&#8217;ll have to check it out.</p>
<p>I&#8217;ve been toying with the idea of extending backbone to include automated dependency injection, but could not convince myself of the advantages. Like you, I was referring to my experience in C# (WPF) as well as Actionscript (Flash). </p>
<p>Currently I use the approach you describe here by attaching an event bus to the application namespace. I do the same with a model that needs to be accessed from multiple areas of the app. It &#8220;feels&#8221; bad to do, but after reading your post I&#8217;m somewhat convinced to stick with it. Anything else seems to overcomplicate things as it tries to deal with hurdles that just do not exist in Javascript.</p>
<p>Some posts below mention that this approach could lead to a &#8220;dumping ground&#8221;. Totally true, but Javascript itself is one huge dumping ground already. It&#8217;s really up to the developers to discipline themselves.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kerry Gallagher</title>
		<link>http://lostechies.com/derickbailey/2012/04/03/revisiting-the-backbone-event-aggregator-lessons-learned/#comment-2772</link>
		<dc:creator>Kerry Gallagher</dc:creator>
		<pubDate>Mon, 08 Oct 2012 13:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=863#comment-2772</guid>
		<description>Thanks Derick, no need to apologise at all :)


That makes perfect sense - I realise now at the time I posted the comment I was also unaware of the third argument in .off, the context, which also answers my own question. Backbone.js has really made me learn about things like events (which you almost take for granted when doing JS development), object lifespan etc in depth - which can only be a good thing, but also kinda scary when things you thought you knew...you really don&#039;t. But, posts like yours have really helped me along the way, so thank you :)</description>
		<content:encoded><![CDATA[<p>Thanks Derick, no need to apologise at all :)</p>
<p>That makes perfect sense &#8211; I realise now at the time I posted the comment I was also unaware of the third argument in .off, the context, which also answers my own question. Backbone.js has really made me learn about things like events (which you almost take for granted when doing JS development), object lifespan etc in depth &#8211; which can only be a good thing, but also kinda scary when things you thought you knew&#8230;you really don&#8217;t. But, posts like yours have really helped me along the way, so thank you :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derick Bailey</title>
		<link>http://lostechies.com/derickbailey/2012/04/03/revisiting-the-backbone-event-aggregator-lessons-learned/#comment-2762</link>
		<dc:creator>Derick Bailey</dc:creator>
		<pubDate>Sat, 29 Sep 2012 01:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=863#comment-2762</guid>
		<description>Hi Kerry - I&#039;m sorry I haven&#039;t responded until now. It&#039;s been a rather busy few weeks for me. 


For handling global events with an event binder, and needing to clean up just the ones that were for the specific part of the app that I&#039;m in, I just create my own instance of an event binder and add only the events that I need at that point in time. Then I can &quot;unbindAll&quot; on that event binder instance when I need to, and not worry about destroying all of the app level events.


you can see an example of this in the wiki here: https://github.com/marionettejs/backbone.marionette/wiki/When-to-use-the-EventBinder


Hope that helps. If you have any more questions about this, it would be best to ask on the google group for marionette: https://groups.google.com/forum/#!forum/backbone-marionette</description>
		<content:encoded><![CDATA[<p>Hi Kerry &#8211; I&#8217;m sorry I haven&#8217;t responded until now. It&#8217;s been a rather busy few weeks for me. </p>
<p>For handling global events with an event binder, and needing to clean up just the ones that were for the specific part of the app that I&#8217;m in, I just create my own instance of an event binder and add only the events that I need at that point in time. Then I can &#8220;unbindAll&#8221; on that event binder instance when I need to, and not worry about destroying all of the app level events.</p>
<p>you can see an example of this in the wiki here: <a href="https://github.com/marionettejs/backbone.marionette/wiki/When-to-use-the-EventBinder" rel="nofollow">https://github.com/marionettejs/backbone.marionette/wiki/When-to-use-the-EventBinder</a></p>
<p>Hope that helps. If you have any more questions about this, it would be best to ask on the google group for marionette: <a href="https://groups.google.com/forum/#!forum/backbone-marionette" rel="nofollow">https://groups.google.com/forum/#!forum/backbone-marionette</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kerry Gallagher</title>
		<link>http://lostechies.com/derickbailey/2012/04/03/revisiting-the-backbone-event-aggregator-lessons-learned/#comment-2747</link>
		<dc:creator>Kerry Gallagher</dc:creator>
		<pubDate>Thu, 13 Sep 2012 16:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=863#comment-2747</guid>
		<description>Great post as always Derick, your posts have really helped me get to grips with Backbone.js over the past couple of months - thank you, but I was wondering if I could just pick your brains on something...


I&#039;ve been implementing your idea of an event aggregator, but also much of the advice that you give on Zombie views and proper cleanup. How do you deal with cleanup code not accidentally unbinding global event aggregator events for other views? I&#039;ll elaborate, because I know that makes no sense on it&#039;s own!

Say you hit a route, this route passes off to a controller method that instantiates some views, models etc - standard stuff, lastly the controller calls the app level showView method to swap in the new view, and clean up the old one. So the following happens:

- When the controller method is called View A is instantiated, View A makes some bindings to the global event aggregator.

- The last part of the controller method is calling showView, showView calls close on View B, who had some bindings to the same type of event that A is now bound to. So as part of View B&#039;s cleanup all of it&#039;s bindings to the global event aggregator are unbound. 


- View B&#039;s cleanup includes, for example, something like App.vent.off(&quot;thing:clicked&quot;, this.openMe);


- As this is a global, View A&#039;s newly bound events are also unbound at the same time. 

Should I just not be making event aggregator bindings in my &#039;top-level&#039; view? (e.g. View A renders in sub-views, they&#039;re okay, events unaffected, as they&#039;re not actually instantiated until render() is called on view A as the last part of showView)

Or should I be namespacing these events or something similar?


Sorry that took so long to explain, and many thanks if you can offer any help :)</description>
		<content:encoded><![CDATA[<p>Great post as always Derick, your posts have really helped me get to grips with Backbone.js over the past couple of months &#8211; thank you, but I was wondering if I could just pick your brains on something&#8230;</p>
<p>I&#8217;ve been implementing your idea of an event aggregator, but also much of the advice that you give on Zombie views and proper cleanup. How do you deal with cleanup code not accidentally unbinding global event aggregator events for other views? I&#8217;ll elaborate, because I know that makes no sense on it&#8217;s own!</p>
<p>Say you hit a route, this route passes off to a controller method that instantiates some views, models etc &#8211; standard stuff, lastly the controller calls the app level showView method to swap in the new view, and clean up the old one. So the following happens:</p>
<p>- When the controller method is called View A is instantiated, View A makes some bindings to the global event aggregator.</p>
<p>- The last part of the controller method is calling showView, showView calls close on View B, who had some bindings to the same type of event that A is now bound to. So as part of View B&#8217;s cleanup all of it&#8217;s bindings to the global event aggregator are unbound. </p>
<p>- View B&#8217;s cleanup includes, for example, something like App.vent.off(&#8220;thing:clicked&#8221;, this.openMe);</p>
<p>- As this is a global, View A&#8217;s newly bound events are also unbound at the same time. </p>
<p>Should I just not be making event aggregator bindings in my &#8216;top-level&#8217; view? (e.g. View A renders in sub-views, they&#8217;re okay, events unaffected, as they&#8217;re not actually instantiated until render() is called on view A as the last part of showView)</p>
<p>Or should I be namespacing these events or something similar?</p>
<p>Sorry that took so long to explain, and many thanks if you can offer any help :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derick Bailey</title>
		<link>http://lostechies.com/derickbailey/2012/04/03/revisiting-the-backbone-event-aggregator-lessons-learned/#comment-2691</link>
		<dc:creator>Derick Bailey</dc:creator>
		<pubDate>Thu, 16 Aug 2012 15:29:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=863#comment-2691</guid>
		<description>why does backbone provide it&#039;s own event system if jquery&#039;s would work good enough? partially because jquery isn&#039;t a requirement. zepto and others can be used. you can also leave DOM manipulation out of your backbone apps entirely. you just can&#039;t use Backbone.view. 


also, semantics and separation of concerns are important. i don&#039;t want my event aggregator to be associated with or require a DOM manipulation library because event aggregation has nothing to do with DOM manipulation.


but there&#039;s no reason you can&#039;t use jquery for your event aggregator in your apps.</description>
		<content:encoded><![CDATA[<p>why does backbone provide it&#8217;s own event system if jquery&#8217;s would work good enough? partially because jquery isn&#8217;t a requirement. zepto and others can be used. you can also leave DOM manipulation out of your backbone apps entirely. you just can&#8217;t use Backbone.view. </p>
<p>also, semantics and separation of concerns are important. i don&#8217;t want my event aggregator to be associated with or require a DOM manipulation library because event aggregation has nothing to do with DOM manipulation.</p>
<p>but there&#8217;s no reason you can&#8217;t use jquery for your event aggregator in your apps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Agthe</title>
		<link>http://lostechies.com/derickbailey/2012/04/03/revisiting-the-backbone-event-aggregator-lessons-learned/#comment-2689</link>
		<dc:creator>Robert Agthe</dc:creator>
		<pubDate>Thu, 16 Aug 2012 12:29:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=863#comment-2689</guid>
		<description>Thanks for your post Derick, very helpful. Speaks something against jQuerys &quot;custom events&quot; as an Event Aggregator? As far as i know is it more or less the same thing. And because backbone relies already on jquery, an additional event aggregator should become obsolete.</description>
		<content:encoded><![CDATA[<p>Thanks for your post Derick, very helpful. Speaks something against jQuerys &#8220;custom events&#8221; as an Event Aggregator? As far as i know is it more or less the same thing. And because backbone relies already on jquery, an additional event aggregator should become obsolete.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derick Bailey</title>
		<link>http://lostechies.com/derickbailey/2012/04/03/revisiting-the-backbone-event-aggregator-lessons-learned/#comment-2662</link>
		<dc:creator>Derick Bailey</dc:creator>
		<pubDate>Wed, 01 Aug 2012 22:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=863#comment-2662</guid>
		<description>right... we&#039;re saying the same thing, then. :) 


i just showed a really poor example, because ... well... it&#039;s an example :D</description>
		<content:encoded><![CDATA[<p>right&#8230; we&#8217;re saying the same thing, then. :) </p>
<p>i just showed a really poor example, because &#8230; well&#8230; it&#8217;s an example :D</p>
]]></content:encoded>
	</item>
</channel>
</rss>
