thoughtbot/backbone-support — Issue #3: Class inheritance is overkill
Author: ngauthier
Created: 2011-11-30 15:53:54+00:00
State: open

in here: https://github.com/thoughtbot/backbone-support/blob/master/lib/assets/javascripts/backbone-support/swapping_router.js

You are using _'s `extend` which requires you to extend the prototype as well, but Backbone JS has its own extend method:

http://documentcloud.github.com/backbone/#Model-extend

It is self-propagating so objects that `extend` a method with this `extend` method get their own `extend` method as well:
https://github.com/documentcloud/backbone/blob/master/backbone.js#L992

And also inherits the prototype for you:
https://github.com/documentcloud/backbone/blob/master/backbone.js#L1081

When I started working with backbone, it didn't work like this, so I ended up doing something similar to what you guys have, but since they improved `extend` it's much easier to subclass.

Unless of course there's something I'm missing here about the behavior of `extend` :-)

Thanks for sharing your code.

-@ngauthier