Atjaunināt sīkdatņu piekrišanu

Developing Backbone.js Applications [Mīkstie vāki]

3.69/5 (347 ratings by Goodreads)
  • Formāts: Paperback / softback, 150 pages
  • Izdošanas datums: 25-Jun-2013
  • Izdevniecība: O'Reilly Media
  • ISBN-10: 1449328253
  • ISBN-13: 9781449328252
Citas grāmatas par šo tēmu:
  • Mīkstie vāki
  • Cena: 42,08 €*
  • * ši ir gala cena, t.i., netiek piemērotas nekādas papildus atlaides
  • Standarta cena: 49,50 €
  • Ietaupiet 15%
  • Grāmatu piegādes laiks ir 3-4 nedēļas, ja grāmata ir uz vietas izdevniecības noliktavā. Ja izdevējam nepieciešams publicēt jaunu tirāžu, grāmatas piegāde var aizkavēties.
  • Daudzums:
  • Ielikt grozā
  • Piegādes laiks - 4-6 nedēļas
  • Pievienot vēlmju sarakstam
  • Formāts: Paperback / softback, 150 pages
  • Izdošanas datums: 25-Jun-2013
  • Izdevniecība: O'Reilly Media
  • ISBN-10: 1449328253
  • ISBN-13: 9781449328252
Citas grāmatas par šo tēmu:
Provides information on building structured JavaScript applications with Backbone.js.

If you want to build your site’s frontend with the single-page application (SPA) model, this hands-on book shows you how to get the job done with Backbone.js. You’ll learn how to create structured JavaScript applications, using Backbone’s own flavor of model-view-controller (MVC) architecture.

Start with the basics of MVC, SPA, and Backbone, then get your hands dirty building sample applications—a simple Todo list app, a RESTful book library app, and a modular app with Backbone and RequireJS. Author Addy Osmani, an engineer for Google’s Chrome team, also demonstrates advanced uses of the framework.

  • Learn how Backbone.js brings MVC benefits to the client-side
  • Write code that can be easily read, structured, and extended
  • Work with the Backbone.Marionette and Thorax extension frameworks
  • Solve common problems you’ll encounter when using Backbone.js
  • Organize your code into modules with AMD and RequireJS
  • Paginate data for your Collections with the Backbone.Paginator plugin
  • Bootstrap a new Backbone.js application with boilerplate code
  • Use Backbone with jQuery Mobile and resolve routing problems between the two
  • Unit-test your Backbone apps with Jasmine, QUnit, and SinonJS
Preface xi
1 Introduction
1(8)
What Is MVC?
2(1)
What Is Backbone.js?
2(1)
When Do I Need a JavaScript MVC Framework?
3(1)
Why Consider Backbone.js?
4(1)
Setting Expectations
5(4)
2 Fundamentals
9(18)
MVC
9(1)
Smalltalk-80 MVC
9(1)
MVC Applied to the Web
10(3)
Client-Side MVC and Single-Page Apps
13(2)
Client-Side MVC: Backbone Style
15(3)
Implementation Specifics
18(3)
What Does MVC Give Us?
21(1)
Delving Deeper into MVC
21(1)
Summary
22(1)
Further Reading
22(1)
Fast Facts
22(1)
Backbone.js
22(1)
Used by
23(4)
3 Backbone Basics
27(46)
Getting Set Up
27(1)
Models
28(1)
Initialization
29(1)
Getters and Setters
30(2)
Listening for Changes to Your Model
32(2)
Validation
34(1)
Views
35(1)
Creating New Views
36(1)
What Is el?
36(6)
Collections
42(1)
Adding and Removing Models
42(1)
Retrieving Models
43(1)
Listening for Events
44(2)
Resetting/Refreshing Collections
46(2)
Underscore Utility Functions
48(4)
Chainable API
52(1)
RESTful Persistence
53(1)
Fetching Models from the Server
53(1)
Saving Models to the Server
54(1)
Deleting Models from the Server
54(1)
Options
55(1)
Events
55(1)
on(), off(), and trigger()
56(3)
listenTo() and stopListening()
59(1)
Events and Views
60(2)
Routers
62(2)
Backbone.history
64(2)
Backbone's Sync API
66(2)
Overriding Backbone.sync
68(2)
Dependencies
70(1)
Summary
70(3)
4 Exercise 1: Todos-Your First Backbone.js App
73(22)
Static HTML
74(1)
Header and Scripts
74(1)
Application HTML
75(1)
Templates
76(1)
Todo Model
77(1)
Todo Collection
78(1)
Application View
79(6)
Individual Todo View
85(2)
Startup
87(1)
In Action
87(2)
Completing and Deleting Todos
89(3)
Todo Routing
92(2)
Summary
94(1)
5 Exercise 2: Book Library-Your First RESTful Backbone.js App
95(30)
Setting Up
95(5)
Creating the Model, Collection, Views, and App
100(3)
Wiring in the Interface
103(1)
Adding Models
103(2)
Removing Models
105(1)
Creating the Backend
106(1)
Install Node.js, npm, and MongoDB
106(1)
Install Node Modules
106(1)
Create a Simple Web Server
107(2)
Connect to the Database
109(7)
Talking to the Server
116(7)
Summary
123(2)
6 Backbone Extensions
125(28)
MarionetteJS (Backbone.Marionette)
125(2)
Boilerplate Rendering Code
127(1)
Reducing Boilerplate with Marionette.ItemView
128(1)
Memory Management
128(4)
Region Management
132(1)
Marionette Todo App
133(10)
Is the Marionette Implementation of the Todo App More Maintainable?
143(1)
Marionette and Flexibility
144(1)
And So Much More
145(1)
Thorax
145(1)
Hello World
146(1)
Embedding Child Views
146(1)
View Helpers
147(1)
collection Helper
148(1)
Custom HTML Data Attributes
149(2)
Thorax Resources
151(1)
Summary
151(2)
7 Common Problems and Solutions
153(26)
Working with Nested Views
153(1)
Problem
153(1)
Solution 1
153(1)
Solution 2
154(1)
Solution 3
155(1)
Solution 4
155(2)
Managing Models in Nested Views
157(1)
Problem
157(1)
Solution
157(1)
Rendering a Parent View from a Child View
158(1)
Problem
158(1)
Solution
158(1)
Disposing View Hierarchies
159(1)
Problem
159(1)
Solution
159(1)
Rendering View Hierarchies
160(1)
Problem
160(1)
Solution
160(1)
Working with Nested Models or Collections
161(1)
Problem
161(1)
Solution
161(1)
Better Model Property Validation
162(1)
Problem
162(1)
Solution
162(2)
Backbone.validateAll
164(2)
Backbone. Validation
166(1)
Form-Specific Validation Classes
167(1)
Avoiding Conflicts with Multiple Backbone Versions
167(1)
Problem
167(1)
Solution
167(1)
Building Model and View Hierarchies
168(1)
Problem
168(1)
Solution
168(1)
Calling Overridden Methods
169(2)
Backbone-Super
171(1)
Event Aggregators and Mediators
171(1)
Problem
171(1)
Solution
172(1)
Event Aggregator
172(1)
Mediator
173(1)
Similarities and Differences
174(1)
Relationships: When to Use Which
175(1)
Event Aggregator and Mediator Together
176(1)
Pattern Language: Semantics
177(2)
8 Modular Development
179(16)
Organizing Modules with RequireJS and AMD
180(1)
Maintainability Problems with Multiple Script Files
180(1)
Need for Better Dependency Management
181(1)
Asynchronous Module Definition (AMD)
181(1)
Writing AMD Modules with RequireJS
181(2)
Getting Started with RequireJS
183(3)
Require.js and Backbone Examples
186(3)
Keeping Your Templates External Using RequireJS and the Text Plug-in
189(1)
Optimizing Backbone Apps for Production with the RequireJS Optimizer
190(3)
Summary
193(2)
9 Exercise 3: Your First Modular Backbone and RequireJS App
195(12)
Overview
195(1)
Markup
196(1)
Configuration Options
197(1)
Modularizing Our Models, Views, and Collections
198(5)
Route-Based Module Loading
203(1)
JSON-Based Module Configuration
203(1)
Module Loader Router
204(1)
Using NodeJS to Handle pushState
205(1)
An Asset Package Alternative for Dependency Management
206(1)
10 Paginating Backbone.js Requests and Collections
207(18)
Backbone.Paginator
208(1)
Live Examples
209(1)
Paginator.requestPager
209(4)
Convenience Methods
213(1)
Paginator.clientPager
214(2)
Convenience Methods
216(2)
Implementation Notes
218(2)
Plug-ins
220(1)
Bootstrapping
221(1)
Styling
221(2)
Summary
223(2)
11 Backbone Boilerplate and Grunt-BBB
225(16)
Getting Started
227(1)
Creating a New Project
227(1)
index.html
228(1)
config.js
229(2)
main.js
231(1)
app.js
232(2)
Creating Backbone Boilerplate Modules
234(2)
router.js
236(1)
Other Useful Tools and Projects
237(1)
Yeoman
238(1)
Backbone DevTools
239(1)
Summary
240(1)
12 Backbone and jQuery Mobile
241(24)
Mobile App Development with jQuery Mobile
241(1)
The Principle of Progressive Widget Enhancement by jQMobile
242(1)
Understanding jQuery Mobile Navigation
243(2)
Basic Backbone App Setup for jQuery Mobile
245(3)
Workflow with Backbone and jQueryMobile
248(1)
Routing to a Concrete View Page, Inheriting from BasicView
249(1)
Management of Mobile Page Templates
250(2)
DOM Management and mobile.changePage
252(4)
Applying Advanced jQM Techniques to Backbone
256(1)
Dynamic DOM Scripting
256(1)
Intercepting jQuery Mobile Events
257(1)
Performance
258(1)
Clever Multiplatform Support Management
259(6)
13 Jasmine
265(24)
Behavior-Driven Development
265(2)
Suites, Specs, and Spies
267(4)
beforeEach() and afterEach()
271(2)
Shared Scope
273(1)
Getting Set Up
274(1)
TDD with Backbone
275(1)
Models
275(2)
Collections
277(2)
Views
279(1)
View Testing
280(7)
Exercise
287(1)
Further Reading
288(1)
Summary
288(1)
14 QUnit
289(14)
Getting Set Up
289(1)
Sample HTML with QUnit-Compatible Markup
290(2)
Assertions
292(1)
Basic Test Case Using test(name, callback)
293(1)
Comparing the Actual Output of a Function Against the Expected Output
293(1)
Adding Structure to Assertions
294(1)
Basic QUnit Modules
294(1)
Using setup() and teardown()
294(1)
Using setup() and teardown() for Instantiation and Clean Up
295(1)
Assertion Examples
296(1)
Fixtures
297(1)
Fixtures Example
298(2)
Asynchronous Code
300(3)
15 SinonJS
303(12)
What Is SinonJS?
303(1)
Basic Spies
304(1)
Spying on Existing Functions
304(1)
Inspection Interface
304(2)
Stubs and Mocks
306(1)
Stubs
306(2)
Mocks
308(1)
Exercise
308(1)
Models
309(1)
Collections
310(1)
Views
311(2)
App
313(1)
Further Reading and Resources
314(1)
16 Conclusions
315(4)
A Further Learning 319(18)
B Resources 337(2)
Index 339
Addy Osmani is a writer, speaker, and a JavaScript developer. He is a member of the jQuery core [ Bug Triage/Docs/Learning] teams where helps with bugs, documentation, and developer evangelism. When not working at AOL his personal OS projects include jQuery UI Bootstrap and TodoMVC, which help developers compare JavaScript MVC frameworks. Addy is the author of the popular ebook, Essential JavaScript Design Patterns. His personal blog is http://addyosmani.com/blog/