Developing Backbone.js Applications:
Gespeichert in:
Beteilige Person: | |
---|---|
Format: | Buch |
Sprache: | Englisch |
Veröffentlicht: |
Beijing [u.a.]
O'Reilly
2013
|
Ausgabe: | 1. ed. |
Schriftenreihe: | Building Better JavaScript Applications
|
Schlagwörter: | |
Links: | http://deposit.dnb.de/cgi-bin/dokserv?id=4027556&prov=M&dok_var=1&dok_ext=htm http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=026052822&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
Umfang: | XVI, 354 S. Ill. |
ISBN: | 9781449328252 1449328253 |
Internformat
MARC
LEADER | 00000nam a2200000 c 4500 | ||
---|---|---|---|
001 | BV041075940 | ||
003 | DE-604 | ||
005 | 20131016 | ||
007 | t| | ||
008 | 130607s2013 xx a||| |||| 00||| eng d | ||
015 | |a 12,N20 |2 dnb | ||
016 | 7 | |a 1022034162 |2 DE-101 | |
020 | |a 9781449328252 |c : EUR 24.50 (DE) (freier Pr.) |9 978-1-449-32825-2 | ||
020 | |a 1449328253 |9 1-449-32825-3 | ||
024 | 3 | |a 9781449328252 | |
035 | |a (OCoLC)852658973 | ||
035 | |a (DE-599)DNB1022034162 | ||
040 | |a DE-604 |b ger |e rakddb | ||
041 | 0 | |a eng | |
049 | |a DE-29T |a DE-573 |a DE-Aug4 | ||
084 | |a ST 250 |0 (DE-625)143626: |2 rvk | ||
084 | |a 004 |2 sdnb | ||
100 | 1 | |a Osmani, Addy |e Verfasser |0 (DE-588)1026169062 |4 aut | |
245 | 1 | 0 | |a Developing Backbone.js Applications |c Addy Osmani |
250 | |a 1. ed. | ||
264 | 1 | |a Beijing [u.a.] |b O'Reilly |c 2013 | |
300 | |a XVI, 354 S. |b Ill. | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
490 | 0 | |a Building Better JavaScript Applications | |
650 | 0 | 7 | |a JavaScript |0 (DE-588)4420180-1 |2 gnd |9 rswk-swf |
689 | 0 | 0 | |a JavaScript |0 (DE-588)4420180-1 |D s |
689 | 0 | |5 DE-604 | |
856 | 4 | 2 | |m X:MVB |q text/html |u http://deposit.dnb.de/cgi-bin/dokserv?id=4027556&prov=M&dok_var=1&dok_ext=htm |3 Inhaltstext |
856 | 4 | 2 | |m HBZ Datenaustausch |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=026052822&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
943 | 1 | |a oai:aleph.bib-bvb.de:BVB01-026052822 |
Datensatz im Suchindex
_version_ | 1819376632686706688 |
---|---|
adam_text | Titel: Developing Backbone.js applications
Autor: Osmani, Addy
Jahr: 2013
Table of Contents
Preface xi
1. Introduction 1
What Is MVC? 2
What Is Backbone.js? 2
When Do I Need a JavaScript MVC Framework? 3
Why Consider Backbone.js? 4
Setting Expectations 5
2. Fundamentals 9
MVC 9
Smalltalk-80 MVC 9
MVC Applied to the Web 10
Client-Side MVC and Single-Page Apps 13
Client-Side MVC: Backbone Style 15
Implementation Specifics 18
What Does MVC Give Us? 21
Delving Deeper into MVC 21
Summary 22
Further Reading 22
Fast Facts 22
Backbone.js 22
Used by 23
3. Backbone Basics 27
Getting Set Up 27
Models 28
Initialization 29
Getters and Setters 30
iii
Listening for Changes to Your Model
Validation
Views
Creating New Views
What Is el?
Collections
Adding and Removing Models
Retrieving Models
Listening for Events
Resetting/Refreshing Collections
Underscore Utility Functions
Chainable API
RESTful Persistence
Fetching Models from the Server
Saving Models to the Server
Deleting Models from the Server
Options
Events
on(), off(), and trigger()
listenToO and stopListening()
Events and Views
Routers
Backbone.history
Backbone s Sync API
Overriding Backbone.sync
Dependencies
Summary
4. Exercise 1 : Todos—Your First Backbone.js App,
Static HTML
Header and Scripts
Application HTML
Templates
Todo Model
Todo Collection
Application View
Individual TodoView
Startup
In Action
Completing and Deleting Todos
Todo Routing
32
34
35
36
36
42
42
43
44
46
48
52
53
53
54
54
55
55
56
59
60
62
64
66
68
70
70
73
74
74
75
76
77
78
79
85
87
87
89
92
iv I Table of Contents
Summary
94
5. Exercise 2: Book Library—Your First RESTful Backbone.js App 95
Setting Up 95
Creating the Model, Collection, Views, and App 100
Wiring in the Interface 103
Adding Models 103
Removing Models 105
Creating the Backend 106
Install Node.js, npm, and MongoDB 106
Install Node Modules 106
Create a Simple Web Server 107
Connect to the Database 109
Talking to the Server 116
Summary 123
6. Backbone Extensions 125
MarionetteJS (Backbone.Marionette) 125
Boilerplate Rendering Code 127
Reducing Boilerplate with Marionette.ItemView 128
Memory Management 128
Region Management 132
Marionette Todo App 133
Is the Marionette Implementation of the Todo App More Maintainable? 143
Marionette and Flexibility 144
And So Much More 145
Thorax 145
Hello World 146
Embedding Child Views 146
View Helpers 147
collection Helper 148
Custom HTML Data Attributes 149
Thorax Resources 151
Summary 151
7. Common Problems and Solutions 153
Working with Nested Views 153
Problem 153
Solution 1 153
Solution 2 154
Solution 3 155
Solution 4 155
Table of Contents | v
Managing Models in Nested Views
Problem 157
Solution
Rendering a Parent View from a Child View 158
Problem
Solution
Disposing View Hierarchies 159
Problem 159
Solution 159
Rendering View Hierarchies 160
Problem 160
Solution 160
Working with Nested Models or Collections 161
Problem *61
Solution 161
Better Model Property Validation 162
Problem 162
Solution 162
Backbone, validate All 164
Backbone.Validation 166
Form-Specific Validation Classes 167
Avoiding Conflicts with Multiple Backbone Versions 167
Problem 167
Solution 167
Building Model and View Hierarchies 168
Problem 168
Solution 168
Calling Overridden Methods 169
Backbone-Super 171
Event Aggregators and Mediators 171
Problem 171
Solution 172
Event Aggregator 172
Mediator 173
Similarities and Differences 174
Relationships: When to Use Which 175
Event Aggregator and Mediator Together 176
Pattern Language: Semantics 177
8. Modular Development 179
Organizing Modules with RequireJS and AMD 180
Maintainability Problems with Multiple Script Files 180
vi I Table of Contents
Need for Better Dependency Management 181
Asynchronous Module Definition (AMD) 181
Writing AMD Modules with RequirefS 181
Getting Started with RequireJS 183
Require, j s and Backbone Examples 186
Keeping Your Templates External Using RequireJS and the Text Plug-in 189
Optimizing Backbone Apps for Production with the RequireJS Optimizer 190
Summary 193
9. Exercise 3: Your First Modular Backbone and RequireJS App 195
Overview 195
Markup 196
Configuration Options 197
Modularizing Our Models, Views, and Collections 198
Route-Based Module Loading 203
JSON-Based Module Configuration 203
Module Loader Router 204
Using NodeJS to Handle pushState 205
An Asset Package Alternative for Dependency Management 206
10. Paginating Backbone.js Requests and Collections 207
Backbone.Paginator 208
Live Examples 209
Paginator.requestPager 209
Convenience Methods 213
Paginator.clientPager 214
Convenience Methods 216
Implementation Notes 218
Plug-ins 220
Bootstrapping 221
Styling 221
Summary 223
11. Backbone Boilerplate and Grunt-BBB 225
Getting Started 227
Creating a New Project 227
index.html 228
config.js 229
main.js 231
app.js 232
Creating Backbone Boilerplate Modules 234
router.js 236
Table of Contents | vii
Other Useful Tools and Projects
Yeoman
Backbone DevTools ^39
Summary 24®
12. Backbone and jQuery Mobile 24^
Mobile App Development with jQuery Mobile 241
The Principle of Progressive Widget Enhancement by jQMobile 242
Understanding jQuery Mobile Navigation 243
Basic Backbone App Setup for jQuery Mobile 245
Workflow with Backbone and jQueryMobile 248
Routing to a Concrete View Page, Inheriting from Basic View 249
Management of Mobile Page Templates 250
DOM Management and $.mobile.changePage 252
Applying Advanced jQM Techniques to Backbone 256
Dynamic DOM Scripting 256
Intercepting jQuery Mobile Events 257
Performance 258
Clever Multiplatform Support Management 259
13. Jasmine 265
Behavior-Driven Development 265
Suites, Specs, and Spies 267
beforeEachO and afterEach() 271
Shared Scope 273
Getting Set Up 274
TDD with Backbone 275
Models 275
Collections 277
Views 279
View Testing 280
Exercise 287
Further Reading 288
Summary 288
14. QUnit 289
Getting Set Up 289
Sample HTML with QUnit-Compatible Markup 290
Assertions 292
Basic Test Case Using test( name, callback ) 293
Comparing the Actual Output of a Function Against the Expected Output 293
Adding Structure to Assertions 9Q,
viii I Table of Contents
Basic QUnit Modules 294
Using setupO and teardown() 294
Using setupO and teardown() for Instantiation and Clean Up 295
Assertion Examples 296
Fixtures 297
Fixtures Example 298
Asynchronous Code 300
15. SinonJS 303
What Is SinonJS? 303
Basic Spies 304
Spying on Existing Functions 304
Inspection Interface 304
Stubs and Mocks 306
Stubs 306
Mocks 308
Exercise 308
Models 309
Collections 310
Views 311
App 313
Further Reading and Resources 314
16. Conclusions 315
A. Further Learning 319
B. Resources 337
Index 339
Table of Contents ¡ ix
|
any_adam_object | 1 |
author | Osmani, Addy |
author_GND | (DE-588)1026169062 |
author_facet | Osmani, Addy |
author_role | aut |
author_sort | Osmani, Addy |
author_variant | a o ao |
building | Verbundindex |
bvnumber | BV041075940 |
classification_rvk | ST 250 |
ctrlnum | (OCoLC)852658973 (DE-599)DNB1022034162 |
discipline | Informatik |
edition | 1. ed. |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>01556nam a2200409 c 4500</leader><controlfield tag="001">BV041075940</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20131016 </controlfield><controlfield tag="007">t|</controlfield><controlfield tag="008">130607s2013 xx a||| |||| 00||| eng d</controlfield><datafield tag="015" ind1=" " ind2=" "><subfield code="a">12,N20</subfield><subfield code="2">dnb</subfield></datafield><datafield tag="016" ind1="7" ind2=" "><subfield code="a">1022034162</subfield><subfield code="2">DE-101</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9781449328252</subfield><subfield code="c">: EUR 24.50 (DE) (freier Pr.)</subfield><subfield code="9">978-1-449-32825-2</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">1449328253</subfield><subfield code="9">1-449-32825-3</subfield></datafield><datafield tag="024" ind1="3" ind2=" "><subfield code="a">9781449328252</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)852658973</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)DNB1022034162</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield><subfield code="e">rakddb</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-29T</subfield><subfield code="a">DE-573</subfield><subfield code="a">DE-Aug4</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 250</subfield><subfield code="0">(DE-625)143626:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">004</subfield><subfield code="2">sdnb</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Osmani, Addy</subfield><subfield code="e">Verfasser</subfield><subfield code="0">(DE-588)1026169062</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Developing Backbone.js Applications</subfield><subfield code="c">Addy Osmani</subfield></datafield><datafield tag="250" ind1=" " ind2=" "><subfield code="a">1. ed.</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Beijing [u.a.]</subfield><subfield code="b">O'Reilly</subfield><subfield code="c">2013</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">XVI, 354 S.</subfield><subfield code="b">Ill.</subfield></datafield><datafield tag="336" ind1=" " ind2=" "><subfield code="b">txt</subfield><subfield code="2">rdacontent</subfield></datafield><datafield tag="337" ind1=" " ind2=" "><subfield code="b">n</subfield><subfield code="2">rdamedia</subfield></datafield><datafield tag="338" ind1=" " ind2=" "><subfield code="b">nc</subfield><subfield code="2">rdacarrier</subfield></datafield><datafield tag="490" ind1="0" ind2=" "><subfield code="a">Building Better JavaScript Applications</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">JavaScript</subfield><subfield code="0">(DE-588)4420180-1</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><subfield code="a">JavaScript</subfield><subfield code="0">(DE-588)4420180-1</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">X:MVB</subfield><subfield code="q">text/html</subfield><subfield code="u">http://deposit.dnb.de/cgi-bin/dokserv?id=4027556&prov=M&dok_var=1&dok_ext=htm</subfield><subfield code="3">Inhaltstext</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">HBZ Datenaustausch</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=026052822&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="943" ind1="1" ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-026052822</subfield></datafield></record></collection> |
id | DE-604.BV041075940 |
illustrated | Illustrated |
indexdate | 2024-12-20T16:30:12Z |
institution | BVB |
isbn | 9781449328252 1449328253 |
language | English |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-026052822 |
oclc_num | 852658973 |
open_access_boolean | |
owner | DE-29T DE-573 DE-Aug4 |
owner_facet | DE-29T DE-573 DE-Aug4 |
physical | XVI, 354 S. Ill. |
publishDate | 2013 |
publishDateSearch | 2013 |
publishDateSort | 2013 |
publisher | O'Reilly |
record_format | marc |
series2 | Building Better JavaScript Applications |
spellingShingle | Osmani, Addy Developing Backbone.js Applications JavaScript (DE-588)4420180-1 gnd |
subject_GND | (DE-588)4420180-1 |
title | Developing Backbone.js Applications |
title_auth | Developing Backbone.js Applications |
title_exact_search | Developing Backbone.js Applications |
title_full | Developing Backbone.js Applications Addy Osmani |
title_fullStr | Developing Backbone.js Applications Addy Osmani |
title_full_unstemmed | Developing Backbone.js Applications Addy Osmani |
title_short | Developing Backbone.js Applications |
title_sort | developing backbone js applications |
topic | JavaScript (DE-588)4420180-1 gnd |
topic_facet | JavaScript |
url | http://deposit.dnb.de/cgi-bin/dokserv?id=4027556&prov=M&dok_var=1&dok_ext=htm http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=026052822&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT osmaniaddy developingbackbonejsapplications |