Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Backbone.js is a flexible, lightweight tool for structuring the JavaScript in a modern web application. It goes great with Rails! But beware - "flexible and lightweight" are code words for "you build your own plumbing." Backbone is new enough that we haven't established strong patterns for that plumbing yet, so different Backbone codebases look very different, and when you're new to the idea of structuring your JavaScript, it can be tough to tell where the win is. So in this talk I'll demystify Backbone. I'll show several very different ways I've used it on real Rails apps. You'll get a feel for the circumstances when Backbone makes sense, and moreover, when each of the different approaches to Backbone make sense.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In her talk at Rails Conf 2012, Sarah Mei discusses the integration of Backbone.js with Rails, emphasizing its flexibility and the challenges faced by developers. Backbone.js serves as a lightweight framework that structures JavaScript in web applications, differing significantly from Rails' more opinionated structure. Mei shares insight from her experience handling several projects, illustrating the various ways Backbone can be utilized in Rails apps. **Key Points Discussed:** - **Introduction to Backbone.js:** - Backbone is not a traditional MVC framework; it organizes code with models, views, and templates, but lacks a controller, which makes its terminology almost counterintuitive for Rails developers. - **JavaScript Integration Challenges:** - Developers often come from a Rails background with limited JavaScript experience. As web applications evolve, the need for a structured JavaScript approach becomes crucial, especially for increased interactivity and responsiveness. - **Evolution of JavaScript in Rails Apps:** - Mei outlines phases of JavaScript usage in Rails, from relying on simple helpers to using more complex libraries like jQuery, eventually leading to the adoption of frameworks like Backbone. - **Development Patterns:** - Two primary patterns emerge for using Backbone: - **Greenfield apps:** These are new applications where Rails functions as an API, with Backbone handling client-side rendering and navigation management through models and views. - **Frosting approach:** For existing server-rendered apps, Backbone allows for an incremental transformation, overlaying client-side behavior on current server-rendered elements. - Mei emphasizes how Backbone allows for semi-automatic model mirroring, making CRUD operations more straightforward by reducing boilerplate code. - **Event Handling and Rendering:** - Backbone’s event management and DOM manipulation are crucial for creating responsive user experiences, though it introduces complexity that may be difficult for less experienced developers. - **Advice for Developers:** - For new apps, developers might consider more structured frameworks like Ember.js or Meteor. However, Backbone is ideal for transforming existing applications to enhance client-side interactivity due to its flexibility. **Conclusion:** Sarah highlights that while Backbone.js requires more boilerplate code, it provides a necessary structure for developing modern web applications. Developers need to assess their project needs carefully to decide if Backbone aligns with their goals, especially when transitioning from purely server-rendered applications to more interactive client-side experiences.
Suggest modifications
Cancel