On the Catwalk….
This week at the Iron Yard we are learning about Backbone.js while focusing mainly on the router, models, views, and collections. I’ve tackled all of these concepts in the past two weeks, but it can get confusing rather quickly. However, when learning anything new, I try to think of simple ways to modify complex problems. Bob Marley once said, “make it so simple a baby can overstand.” Anyway, armed with the aforementioned wisdom, I constructed an easy-going way of remembering all of this stuff.
However, a model can never become famous, if the can’t be seen! Well, that’s where views come in. They are used to reflect what your applications’ data models look like. They are also used to listen to events and react accordingly. All starting to make a little more sense?
Moreover, it all comes together in collections, as they are simply an ordered set of Models (Christiano and 10 of his friends). Typically a collection (think of an agency)will only use one type of model but models themselves are not limited to a type of collection.
Models, Views, and collections are all extremely difficult principles in their own right to understand, but having these simple analogies to refer to, can help in the long run!