blittle / backbone-nested-models

Backbone Nested Models
86 stars 28 forks source link

Design philosophy, differences between existing solutions? #1

Closed rudolf closed 11 years ago

rudolf commented 11 years ago

Similar to https://github.com/dhruvaray/backbone-associations/issues/32, I'd like to know what's the main difference between backbone-nested and backbone-relational/backbone-associations?

blittle commented 11 years ago

@skaapgif Looking at the git history events, backbone-associations was started around the same time that I began work on Backbone Nested. My main motivations are pretty much the same as backbone-associations, and maybe to the next level. All I intended for is a very simple way and minimal way to automatically nest models/collections within each other. Really all Backbone Nested does is override the model.set() method. If the attribute being set has an associated model or collection defined, Backbone Nested will create that object (if it doesn't exist) or merge it if it does. It also provides a backwards reference to the parent. That is all it does.

Depending on what you are looking for, maybe backbone-associations would be better suited, but overall I found backbone relational large, heavy handed, slow, and difficult to debug. Backbone Relational is 24 kb unminified, compared to Backbone Nested 1.56 kb and Backbone Associations 3.1 kb. That being said, use whatever make sense for you, but understand that Backbone Nested really only automates creating and merging "nested" or sub models/collections.

rudolf commented 11 years ago

Thanks.