You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/2011-10-10-organizing-backbone-using-modules.textile
+58-18
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ p. Unfortunatly Backbone.js does not tell you how to organize your code leaving
11
11
12
12
This was quite a different decision to other Javascript MVC frameworks who were more in favor of setting a development philosophy.
13
13
14
+
Hopefully this tutorial will allow you to build a much more robust project with great separation of concerns between design and code.
15
+
14
16
This tutorial will get you started on combining Backbone.js with "AMD":http://www.com (Asynchronous Module Definitions).
15
17
16
18
h3. What is AMD?
@@ -24,35 +26,73 @@ This tutorial will use "Require.js":http://requirejs.org to implement a modular
24
26
Quick Overview
25
27
* Modular
26
28
* Scalable
29
+
* Compiles well(see "r.js":http)
30
+
* Market Adoption( Dojo 1.6 converted fully to AMD )
27
31
28
32
h3. Why Require.js?
29
33
30
-
p. Require.js has a great community.
34
+
p. Require.js has a boastful community and is growing rapidly. James Burke the author updates Require.js almost daily and responds to user feedback always. He is also a contributer to the AMD specification.
35
+
31
36
32
37
h3. Getting started
33
38
34
39
To easily understand this tutorial you should jump straight into the example code base.
p. The tutorial is only loosely coupled with the example and you will find the example to be more comprehensive.
44
+
45
+
If you would like to see how a particuliar use case would be implemented please visit the Github page and create an issue.(Example Request: How to do nested views)
46
+
47
+
The example isn't super fleshed out but should give you a vague idea.
48
+
49
+
h3. Example File Structure
50
+
51
+
p. There are many different ways to lay out your files and I believe it is actually dependent on the size of the project. In the example below views and template s are mirroed in file structure. Collections and Models aren't categorized into folders.
0 commit comments