In the process of fully grocking backbone. Are there any visual resources or diagrams that represent the full scope of the backbone architecture? Any other resources you would recommend? Thanks!
Look at @Anton's answer to this question: Understanding the internal structural dependencies of MVC in Backbone.js
You really don't need to spend so much time with the architecture - it's a framework that can either be used to help put together using simple OO constructs or an event-based design. You basically have ONLY 4 sets of classes (so to speak)
You follow all OO design practices that you would to help design better - basically helps organize your code and separate their concerns. Try this: for the simplest hello world application, draw a UML class diagram separating the "presenation" of hello-world from the "storage string" - you'll be amazed at how backbone can help you realize the same in javascript!!!
Backbone is jquery's best friend so to speak so you 'organize' your code and use jquery to query the DOM. The style of querying is know context dependent. Assume the following multiple divs
<div class="helloClass">
<div class="innerHello"> Hello World 1</div>
</div>
<div class="helloClass">
<div class="innerHello"> Hello World 2</div>
</div>
<div class="helloClass">
<div class="innerHello"> Hello World 3</div>
</div>
...
To query this using jQuery will require you to either store an id or store data in custom data-* attributes depending on how your application is designed. With Backbone, you create a View for each div and to work on the div you query like this within the view:
var text = $(this.el).find('.innerHello').text();
One example of doing it. Makes searching the DOM faster. You could also do
var text = $('.innerHello', this.el).text();
Hope this helps clarify things. Look up the answer to the above link too...it's a great explanation.
For the rest: http://documentcloud.github.com/backbone/
Ron's Diagrams are cool, and I want to add the set of diagrams you will find in this slides. From this precise slide and to the end of it, pretty complete and really visual.
Hope it helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With