Skip to content

Comment on Backbone.js: Hacker's Guide Part 2 (Backbone.Collection)parent

Comments

Yep -- the key bit here is that on the server you have access to the entire table of rows, so it makes some sense to conflate the, say, Book class with the entire set of all possible books.

On the client side, you very rarely have access to the entire table -- often you have different slices of it based on different search queries, or associations -- every Book has its own collection of Notes, for example. So just mimicking the Rails-style 1:1 mapping can be a bit of a fallacy.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.