9 comments

[ 1.9 ms ] story [ 26.7 ms ] thread
This is all fairly basic patterns. More interesting patterns are using collections inside a model, using sparse arrays or transparent loading (for infinite scroll), creating a "loading" event and handling loading, optimizing number of render calls, complicated routes, and using a vent to pass events and information between views. Those are the 'tougher' challenges I deal with on my backbone apps.
Do you blog about your knowledge in this area? I'd be interested in reading more of what you have to say.
I'd be really interested in reading about these areas as well. It's been cool seeing the emergent knowledge share around Backbone patterns and practices.
I tend to agree. I don't want to discount the nice work that the author put forth, but I grabbed a cheap, well-written ebook here: http://recipeswithbackbone.com/ that has many more of the patterns you mention. It was worth whatever I paid for it.
collections inside a model

I would really love to know the best practice for this, because I was trying to work with something that basically amounted to a model with two or three collections as well as a few simple properties.

But, when I went searching a month or two ago I couldn't really find much in the way of how to handle this sort of nested collection. Is there a good example out there?

i'm using something like that :

SubModel,CollectionSubModel

MainModel { subModelCollection : CollectionSubModel }

ViewSubModel { model: SubModel, collection: MainModel.subModelCollection }

ViewSubModel listens model and collection ( using model.bind() and collection.bind() ). If someting happened, which should inform all submodels i fire an event with a collection.trigger(). Say if i want to hide MainModel, MainModel's View calls model.subModelCollection.trigger('hideParent') before remoing it's "el".

* : i'm sorry if you confused because of my explanation. i tried my best.

Why not fork the project, add some of these topics, and send a pull request?

I'm not being snarky or sarcastic - I personally would love to see some of the more advanced topics you mention included in the list of patterns, in particular loading events and optimisation. Unfortunately I don't think I know enough about Backbone to contribute anything useful - the only non-standard thing I have done so far is basic integration with Celery (https://github.com/mikery/django-celery-backbone).

Thanks a lot, just when i started using Backbone!
Most of these are applicable to Spine, which I recommend you all give a try.