-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
39 lines (33 loc) · 2.08 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
==========================================================================
Project: EnterpriseSC
==========================================================================
The purpose of EnterpriseSC is to establish guidelines for developing large-scale applications using SproutCore. EnterpriseSC will also layout examples of how to implement them. At times these will differ from the implementations commonly given in SproutCore tutorials, as the needs for large-scale applications push those common techniques to their limits.
The principals behind these techniques are as follows:
- Minimize the number of observers at all times
- Minimize the amount of data needed at all times
- Respect the separation of concerns enshrined in MVC
These principals lead to the following techniques:
- The Statechart should be the center of the application, responsible for creating/destroying/showing/hiding all views. To make this explicit, mix SC.StatechartManager into your application object:
MyApp = SC.Application.create(SC.StatechartManager, {
autoInitStatechart: false
});
It is important that the statechart NOT be automatically initialized when it is mixed into your application; it should be initialized separately in main:
MyApp.main = function main() {
MyApp.initStatechart();
};
- The Statechart takes the place of ALL coordinating controllers.
- Application-wide mediating controllers should be minimized or eliminated.
- The Statechart will create and own context-specific mediating controllers.
- The Statechart will make context-specific mediating controllers available to substates where
necessary. A sample of how to do this is in states/abroholos_state.js, where
Tradewinds.AbroholosInternalState is plugged in.
- Do not use SC.Page; views created as part of SC.Page are never destroyed.
- Do not specify bindings when defining views. That is, the following should not be used:
MyApp.MyView = SC.View.extend({
...
labelView = SC.LabelView.extend({
valueBinding: 'MyApp.someController.labelValue'
});
...
});
Instead, after the statechart creates a view it should bind up the properties.