Building Backbone Plugins (The Book + The WatchMeCode Screencasts)
Building Backbone Plugins
Eliminate The Boilerplate In Backbone.js Apps
About the Book
Stop Building Apps With Broken, Boilerplate JavaScript
Master the art of extending and scaling Backbone.js … with just ONE book
Introducing …
Building Backbone PluginsExtending Backbone.js The Smart, Scalable Way
- Learn dozens of time-saving secrets
- Build apps that can handle massive growth
- Say goodbye to spaghetti-code solutions
- Make better architecture decisions
- Write maintainable, problem-free JavaScript
Because There’s a World of Difference Between Using a Framework … and KNOWING It
Get Back to Coding Cool Features Again
You’re not paid to build frameworks — you’re paid to build apps that solve the needs of your business. Building Backbone Plugins will free you from boilerplate code so you can focus on writing your application’s features.
Stop Fumbling Around Your Codebase
Keeping code small and readable is critical as your application evolves. Understanding — at a glance — what the code in any given file does is what makes the difference between being productive and flailing around for hours.
Put an End to Copy & Paste Programming
Boilerplate code requires you to copy-and-paste large chunks of code. Copy-and-paste code creates duplication. Duplication creates a maintenance nightmare. This book will teach you how to stop code-bloat in its tracks with powerful, easy-to-maintain abstractions and extensions.
Minimize Code, Maximize Freedom
Master the art of writing less code that does way more. After stripping down and streamlining your codebase with the help of this book, you’ll have more time to actually implement and improve those inspired, nice-to-have features you love but kept having to put on the back burner.
Understand WHY, Not Just How
This isn’t just a how-to book. It’s a why-to book designed to clarify the concepts and logic that hold Backbone together. Learn the “why” and “how” of building Backbone extensions without losing hours, days, even weeks to hopeless, confusing trial-and-error.
Build Fully Stocked App Architectures
Backbone offers a great, lightweight way to organize jQuery and other JavaScript code, but the trade-off is a lack of a complete app architecture. Building Backbone Plugins fills this gap by showing you what it takes to build scalable applications in Backbone and how to stock your toolbox with exactly what you need.
Get Real-Life, Real-App Tools & Techniques Distilled from Years of Experience with Backbone.js
I don’t know about you, but when I first starting using Backbone.js, I fell in love with it almost immediately.
After weeks of tearing my hair out over the hopeless tangle of JavaScript I’d “built” into my latest app, Backbone seemed like the answer to my prayers:
All of the patterns and practices that I’d learned from Windows development and thick GUI applications right there in front of me … only in JavaScript!
But it wasn’t long before I realized that using Backbone raised problems of its own: for one, a heavy reliance on copy & paste programming. To build out my apps, I had to keep adding more and more boilerplate code — the stuff that has to be there or nothing works right.
All that copy-and-pasting of code inevitably led to the copy-and-pasting of errors … which then required copy-and-paste fixes.
And that, frankly, is a ridiculous and wasteful way to code.
Based on my own trial & error-riddled experiences building MarionetteJS for Backbone, Building Backbone Plugins boils down more than 15 years of software development experience into one simple, easy-to-follow handbook designed to meet the real-life needs of actual JavaScript developers and their clients.
Using MarionetteJS as a reference, this book will show you how to write cleaner, more flexible JavaScript as well as how to keep your applications organized and easy-to-maintain — no matter how complex they get.
– Derick Bailey, creator of MarionetteJS
What Others Are Saying (and Loving!) About The Book
“A treasure trove of knowledge for the Backbone developer concerned with application architecture and extending Backbone” - Chris Webb
“The perfect read given that I was using Backbone in an unstructured manner, leaving many design paradigms in the dust … A great guide on how to transition from a mediocre Backbone web developer to a full-fledged software engineer with Backbone under their tool belt.” - Peter Tseng
“[This book] exposes parts of Backbone that many don’t know about and clearly shows how to extend Backbone in helpful ways that are generic enough to be usable by large numbers of users/projects.” - Joe Zimmerman
“[Building Backbone Plugins] provided me with a bunch of conceptual tools… good enough to roll my own!” - Domingo E. Savoretti
“Gave me a deeper understanding of event-driven applications, what a good backbone architecture looks like, and how to write cleaner code… All the code and examples can be traced back to Marionette, a real-world open source library … I got immediate benefit by applying it at work as I was reading the book, without having to create a project just to try out the concepts!” - Roberto Guerra
“The things I learned from this book will go a long way in both improving our code base as well as the skill-set of my team as a whole!” - Jason Krol
“This book has helped me gain a better understanding of Backbone.js — which will benefit me as well as my clients going forward.” - Paul Paulson
“I see Backbone plugins in a different light now as a result of this book. Whereas previously I regarded plugins as a last resort, now I think of plugins more as an essential enhancement to the Backbone framework. Plugins as explained in this book add a stronger procedural abstraction capability to Backbone … It reminds me somewhat of the power of C++ template metaprogramming compared to early versions of that language that lacked templates.” - Bodine
“I was surprised at the clarity of language and exposition [of Building Backbone Plugins] … This has a degree of polish comparable to books from O’Reilly or Manning. Geeky expertise we expect; clear writing is rare!” - Bodine
“Through example, this book walks you through the common challenges faced in Backbone development and how to sanely tackle those challenges … At least, that’s how it helped me!” - Michael Raumer
“This book is a reference for me every time I pick Backbone as the major library to deal with anything I build on the client side.” - Rui Pedro Lima
“[This book] showed me how Backbone really becomes powerful when properly handling events, especially in the context of using event handlers to trigger change in separate modules. … It’s helping me improve the maintainability and overall quality of the code I’m writing.” - Mike Tiemey
Packages
The Book + The WatchMeCode Screencasts
Get the book + the WatchMeCode.net screencasts that are referenced as additional information, all for one low price! This package includes 4 videos, covering these topics in JavaScript: * Variable Scope In JavaScript * JavaScript Context * Objects and Prototypes * When Context And Prototypes Collide!
English
PDF
EPUB
MOBI
WEB
The Book
Get the book by itself. If you already have my screencasts from WatchMeCode.net, then this package is for you.
English
PDF
EPUB
MOBI
WEB
Table of Contents
-
- Quotes And Praise For Building Backbone Plugins
-
Preface
- Better, Faster, Cheaper
- What Is Backbone?
- Why Are Plugins And Add-ons Neccessary?
- Who Should Read This Book?
- In Relation To MarionetteJS (Backbone.Marionette)
- Copyrights, Code License And Distribution
-
Part 1: Backbone Views
-
Chapter 1: View Rendering
- Extract Whats Common, Specify The Differences
- Lessons Learned
-
Chapter 2: Naming And Namespacing Your Plugin
- Lessons Learned
-
Chapter 3: Complex And Divergent Views
- onRender
- Default serializeData Implementation
- Extracting ModelView And CollectionView
- Lessons Learned
-
Chapter 4: Building A Better CollectionView
- Rendering A Collection Of Views
- API-First Design Of The New CollectionView
-
Rendering Models With A
modelView
Setting - Render A New View On Model Add
- Remove A View On Model Remove
- Close All The Children With The Parent
- Re-Render The Entire List On Reset
- View-Per-Model vs Iterating Models In A Template
- Lessons Learned
-
Chapter 5: Cache Pre-Compiled Templates
- A Texas 2-Step
- Building A Template Cache
- A getPrototypeOf Shim
- Lessons Learned
-
Chapter 6: Overriding Backbone.View’s ‘constructor’
- Setting An Automation ID On All Views
- The Problem Of Taxidermy
- Correctly Overriding The Constructor Function
- Putting The Pieces Together
- Not Just Backbone.View
- Not Every Type You Define
- Lessons Learned
-
Chapter 1: View Rendering
-
Part 2: Managing The DOM
-
Chapter 7: Managing DOM Widgets And Controls
- DOM Dependent/Independent
- Simple Manipulations And Events
- DOM Events And Simple Animations
- jQuery Plugins And UI Controls
- DOM-Dependent UI Controls
- Extracting The onShow Method Call
- Lessons Learned
-
Chapter 8: Swapping Views In The DOM
- A Need To Change Out A View
- A Simple Region For Backbone
- Extracting A Reusable Region Type
- Handing onShow Calls
- Lessons Learned
-
Chapter 9: Managing Nested Views
- Nested Views: The Hard Way
- Defining A Layout, Use-Case-First
- Build The Layout Type
- Closing The Regions With The View
- Re-Rendering The Layout With Regions
- Lessons Learned
-
Chapter 7: Managing DOM Widgets And Controls
-
Part 3: Data And Meta-data
-
Chapter 10: Pickable Models
- Options For Storing Picked State
- Backbone.Picky Namespace
- Picky.PickableModel
- Using A SelectableModel
- Lessons Learned
-
Chapter 11: Pickable Collections
- Multi-Pick Collections
- Listening For Model Picks
- Cleaning Up Event Listeners
- The “pickAll” and “unpickAll” Methods
- Necessary Duplication… For Now
- The “togglePickAll” Method
- Handling Removed Models
- Using A MultiPickCollection
- Lessons Learned
-
Chapter 12: Building Backbone.localStorage
- Storing data on the client
-
Overriding
Backbone.sync
properly - Syncing the data
- Universal Module Definition
- Lessons Learned
-
Chapter 13: A Filtered Collection
- Basic Filtering
- View-Controlled Filtering
- Self-Filtering Collections
- Pure Filtering And Clean Collections
- Rendering The Filtered Collection
- Lessons Learned
-
Chapter 10: Pickable Models
-
Part 4: Application Infrastructure
-
Chapter 14: 3rd Party Events, Commands, And Requests
- Event Aggregators
- Commands
- Request/Response
- Lessons Learned
-
Chapter 15: Boot-strapping A Backbone Application
- An Application Object
- Using Initializers And Starting The App
- Promising To Run Initializers
- Starting Routers
- Lessons Learned
-
Chapter 16: Application Workflow
- A Poorly Constructed Workflow
- Model Explicit Workflow
- The Challenge Of Workflow Objects
- Lessons Learned
-
Chapter 17: Building With Components
- Defining A Component Constructor
-
An
.extend
-able Component - Handling Events Within The Component
- Building A FilteredList Component
- Using The FilteredList Component
- Lessons Learned
-
Chapter 14: 3rd Party Events, Commands, And Requests
-
Appendices
-
Appendix A: Managing Events As Relationships
- The Observer Pattern
- Events And Relationships
- Inverting The Observer Relationship For Backbone.View
- No Silver Bullet For Modeling Relationships
-
Appendix B: 3 Stages of App Initialization
- Stage 1: Download And Parse
- Stage 2: Application Initialization
- Stage 3: State Restoration (optional)
- Lessons Learned
-
Appendix C: A Tale Of Two Patterns
- Event Aggregator
- Mediator
- Similarities And Differences
- Relationships: When To Use Which
- Pattern Language: Semantics
-
Appendix D: Better JavaScript Mixins
- Object Extension Is A Poor Man’s Mixin
- A Problem Of Context
- Solving The Mixin Problem
- A Real Example
- Simplifying Mixins
- An Alternate Implementation: Closures
- Potential Drawbacks
- Backbone.Include
-
Appendix E: Theme And Variation
- Selecting vs Picking
- Knowing When To Move On
- Lessons Learned
- About Derick
- About Jerome Gravel-Niquet
- A Special Offer From Derick
-
Appendix A: Managing Events As Relationships
Authors have earned$10,088,725writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.
Learn more about writing on Leanpub
The Leanpub 45-day 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
Top Books
C++20
Rainer GrimmC++20 is the next big C++ standard after C++11. As C++11 did it, C++20 changes the way we program modern C++. This change is, in particular, due to the big four of C++20: ranges, coroutines, concepts, and modules.
The book is almost daily updated. These incremental updates ease my interaction with the proofreaders.
C++ Best Practices
Jason TurnerLevel up your C++, get the tools working for you, eliminate common problems, and move on to more exciting things!
Atomic Kotlin
Bruce Eckel and Svetlana IsakovaFor both beginning and experienced programmers! From the author of the multi-award-winning Thinking in C++ and Thinking in Java together with a member of the Kotlin language team comes a book that breaks the concepts into small, easy-to-digest "atoms," along with exercises supported by hints and solutions directly inside IntelliJ IDEA!
Sockets and Pipes
Type ClassesSockets and Pipes is not an introduction to Haskell; it is an introduction to writing software in Haskell. Using a handful of everyday Haskell libraries, this book walks through reading the HTTP specification and implementing it to create a web server.
Introducing EventStorming
Alberto BrandoliniThe deepest tutorial and explanation about EventStorming, straight from the inventor.
Composing Software
Eric ElliottAll software design is composition: the act of breaking complex problems down into smaller problems and composing those solutions. Most developers have a limited understanding of compositional techniques. It's time for that to change.
Cloud Strategy
Gregor Hohpe“Strategy is the difference between making a wish and making it come true.” A successful migration to the cloud can transform your organization, but it shouldn’t be driven by wishes. This book tells you how to develop a sound strategy guided by frameworks and decision models without being overly abstract nor getting lost in product details.
node-opcua by example
Etienne RossignonGet the best out of node-opcua through a set of documented examples by the author himself that will allow you to create stunning OPCUA Servers or Clients.
Functional Design and Architecture
Alexander GraninSoftware Design in Functional Programming, Design Patterns and Practices, Methodologies and Application Architectures. How to build real software in Haskell with less efforts and low risks. The first complete source of knowledge.
Ansible for DevOps
Jeff GeerlingAnsible is a simple, but powerful, server and configuration management tool. Learn to use Ansible effectively, whether you manage one server—or thousands.
Top Bundles
- #1
Software Architecture for Developers: Volumes 1 & 2 - Technical leadership and communication
2 Books
"Software Architecture for Developers" is a practical and pragmatic guide to modern, lightweight software architecture, specifically aimed at developers. You'll learn:The essence of software architecture.Why the software architecture role should include coding, coaching and collaboration.The things that you really need to think about before... - #2
Django for Beginners/APIs/Professionals
3 Books
- #3
PowerShell
3 Books
Buy every PowerShell book from Adam Bertram at a 20% discount! - #4
CCIE Service Provider Ultimate Study Bundle
2 Books
Piotr Jablonski, Lukasz Bromirski, and Nick Russo have joined forces to deliver the only CCIE Service Provider training resource you'll ever need. This bundle contains a detailed and challenging collection of workbook labs, plus an extensively detailed technical reference guide. All of us have earned the CCIE Service Provider certification... - #5
Cisco CCNA 200-301 Complet
4 Books
Ce lot comprend les quatre volumes du guide préparation à l'examen de certification Cisco CCNA 200-301. - #6
All the Books of The Medical Futurist
6 Books
We put together the most popular books from The Medical Futurist to provide a clear picture about the major trends shaping the future of medicine and healthcare. Digital health technologies, artificial intelligence, the future of 20 medical specialties, big pharma, data privacy, digital health investments and how technology giants such as Amazon... - #7
Linux Administration Complet
4 Books
Ce lot comprend les quatre volumes du Guide Linux Administration :Linux Administration, Volume 1, Administration fondamentale : Guide pratique de préparation aux examens de certification LPIC 1, Linux Essentials, RHCSA et LFCS. Administration fondamentale. Introduction à Linux. Le Shell. Traitement du texte. Arborescence de fichiers. Sécurité... - #8
Software Architecture and Beautiful APIs
2 Books
There is no better way to learn how to design good APIs than to look at many existing examples, complementing the Software Architecture theory on API design. - #9
Learn Git, Bash, and Terraform the Hard Way
3 Books
Learn Git, Bash and Terraform using the Hard Way method.These technologies are essential tools in the DevOps armoury. These books walk you through their features and subtleties in a simple, gradual way that reinforces learning rather than baffling you with theory. - #10
9 Books-Bundle: Shut Up and Code!
9 Books
"Shut up and code." Laughter in the audience. The hacker had just plugged in his notebook and started sharing his screen to present his super-smart Python script. "Shut up and code" The letters written in a white literal coding font on black background was the hackers' home screen background mantra. At the time, I was a first-year computer...