forked from Joose/Joose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
JooseX.html
148 lines (100 loc) · 5.95 KB
/
JooseX.html
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<h1 id="name">NAME</h1>
<p>Joose.Manual.JooseX - Recommended Joose extensions</p>
<h1 id="joosex">JooseX?</h1>
<p>It's easy to extend and change Joose, and this is part of what makes Joose so powerful. You can use the meta API to do things your own way, add new features, and generally customize your Joose.</p>
<p>Writing your own extensions does require a good understanding of the meta-model. You can start learning about this with the <a href="http://openjsan.org/go?l=Joose.Proto.Class">Joose.Proto.Class</a> docs. There are also several extension recipes in the <a href="../Cookbook.html">Joose.Cookbook</a>.</p>
<p>Explaining how to write extensions is beyond the scope of this manual. Fortunately, lots of people have already written extensions and put them on JSAN for you.</p>
<p>This document covers a few of the ones we like best.</p>
<h1 id="joosex.attribute">JooseX.Attribute</h1>
<p>If you only look at one extension, it should be this one. It provides a lot of additional features for class's attributes, including lazy initialization,
triggering, delegation and much more.</p>
<p>This lets you create much cleaner and fluent APIs.</p>
<pre><code> Class('User', {
has : {
orders : {
isa : Collection.Orders,
handles : {
addOrder : 'add'
}
}
}
})
-instead of-
Class('User', {
has : {
orders : null
},
methods : {
addOrder : function (order) {
this.orders.add(order)
}
}
})
</code></pre>
<p>For further reading please refer to <a href="http://openjsan.org/go?l=JooseX.Attribute">JooseX.Attribute</a></p>
<h1 id="joosex.namespace.depended">JooseX.Namespace.Depended</h1>
<p>This is very flexible implementation of dependency handling system for Joose classes, suitable for usage in production environments.
It integrates directly into class creation process, and supports versioning:</p>
<pre><code> Class('User', {
isa : {
Person : 1.15
},
does : {
Administrator : 1.01
}
use : [ 'DashBoard.Reports' ],
methods : {
generateReport : function () {
var report = new DashBoard.Report()
}
}
})
</code></pre>
<p>The most interesting feature of <code>JooseX.Namespace.Depended</code> is a special "grouped" loading mode, in which it can load a class with any number of recursive dependencies (in-depth) with only 2 http requests
(requires a server-side component). </p>
<p><code>JooseX.Namespace.Depended</code> supports several transport layers (<script> tag, sync/async xhr, ServerJS), resource types (JavaScript, CSS, etc) and its very easy to add your own.</p>
<p>For further reading please refer to <a href="http://openjsan.org/go?l=JooseX.Namespace.Depended">JooseX.Namespace.Depended</a></p>
<h1 id="joosex.bridge.ext">JooseX.Bridge.Ext</h1>
<p>If you are looking for DOM bindings library, running on Joose this extensions is right for you.</p>
<p>It replaces native class system of ExtJS framework with the Joose. The whole process is transparent for user and allows to write ExtJS classes using all capabilities of Joose:</p>
<pre><code> Class('Test.Run.Harness.Browser.UI.TestGrid', {
isa : Ext.grid.GridPanel,
does : ExtX.grid.Grouped,
have : {
harness : null
},
before : {
initComponent : function () {
this.addEvents('rowselect')
...
}
},
after : {
initComponent : function () {
this.getSelectionModel().on('rowselect', this.onRowSelect, this)
....
}
},
methods : {
onRowSelect : function (selModel, indx, record) {
this.fireEvent('rowselect', this, record)
}
}
})
</code></pre>
<p>For further reading please refer to <a href="http://openjsan.org/go?l=JooseX.Bridge.Ext">JooseX.Bridge.Ext</a></p>
<h1 id="joosex.types">JooseX.Types</h1>
<p>Yet to be ported from Joose 2.x</p>
<h1 id="author">AUTHOR</h1>
<p>Nickolay Platonov <a href="mailto:nickolay8@gmail.com">nickolay8@gmail.com</a></p>
<p>Heavily based on the original content of Moose::Manual, by Dave Rolsky <a href="mailto:autarch@urth.org">autarch@urth.org</a></p>
<h1 id="copyrightandlicense">COPYRIGHT AND LICENSE</h1>
<p>Copyright (c) 2008-2009, Malte Ubl, Nickolay Platonov</p>
<p>All rights reserved.</p>
<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p>
<ul>
<li>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</li>
<li>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.</li>
<li>Neither the name of Malte Ubl nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. </li>
</ul>
<p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. </p>