-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi All,
With the current discussion going on the development of Mashup server
and looking at the tools available in Yahoo (YUI), Google (GWT) etc, and
more usage of WSO2Commons adminui's Javascript/AJAX library, we have
come across with the following problems and improvements to
Javascript/AJAX library.
WSO2 Commons Adminui project contains the Javascript/AJAX
library.[https://wso2.org/repos/wso2/trunk/commons]
Adminui's base javascript functionalities are written in the "main.js".
All the functions available in this javascript has been written as pure
functions. Thus, one could use the function say, foo(args..) without any
association with objects. Since this is a base library, an implementor
might have his js that would have the same method say foo(args2..), with
different arguments. Thus, at runtime, if user uses foo(), theres no
guarantee, which foo() is gonna select by runtime.
Thus, we propose the following architecture for our adminui
Javascrtip/AJAX library.
As we expect this library to be used widely, We should be writing this
functions relative to a custom object. So, we propose the object name
should be WSO2. Apart from that as these functions are "common",
everything should be associated with "WSO2.common".
So, the implementation is as follows,
=======================================================================
WSO2.common = {
var xmlHttpRequest, //global variables
send: function(operationName, bodyXML, xslFileName, callURL, objDiv,
loginMethod, callBack) {// impl}, // send function
onError: function() {// impl}, // onError function
_split: function(obj) {// impl}, // split function
... // Other functions
}
========================================================================
Thus, user has do the following to execute a function, ex: executing of
send() function,
WSO2.common.send('foo',someXML,xslFile,url,divObj,false,sendCallback);
As such the above will not cause any unnecessary complications.
We will follow the Java coding standard. As there is no way to represent
a "private" function, we should use "_", thus, _foo() is a private
function. Most of the Javascript libraries follow this standard.
In addition to this, above object should be implemented in
js/common/common.js rather at main.js.
With above proposal, we could simply switch between either to use Raw
AJAX or WSReques.js to communicate with server.
Please be kind enough to send your consensus on this.
If all permits, I would like to volunteer to do the refactoring, and
help to update other projects.
Thank you
Saminda
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFF8B/5YmklbLuW6wYRAlEVAJ9N3U3vbT46ow2+b4QWlPjnPSgkLgCeOMAh
lhDO1ogXGsPVxDDPIL2gxdU=
=eHaY
-----END PGP SIGNATURE-----
_______________________________________________
Commons-dev mailing list
Commons-dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/commons-dev