PDA

View Full Version : RemotingProvider - actions Object question



ckr
27 May 2009, 6:47 PM
Looking at the documentation for the RemotingProvider (http://extjs.com/deploy/ext-3.0-rc1.1/docs/?class=Ext.direct.RemotingProvider&member=actions), the actions are an object literal.

It goes one to state that "each property within the 'actions' object represents a server side Class".

My question is, should the actions really be an array of server side classes? Therefore allowing a provider to have multiple server classes defined. I understand that I can create another property for actions that is a server class, but to me it would seem to be better if it were an array of server classes, not just another property. Have not looked at the source much here, so not sure how big of an impact that would be.

It would also seem to be easier then to generate the JSON API for the provider. You build an API class that has an array of sub-classes which are then your actions (which in turn contain the actual methods/functions to be called).



$API = new someBaseAPI();

$API->actions[] = new dbActionClass; //contains related functions
$API->actions[] = new loginActionClass; //contains related functions
$API->actions[] = new appActionClass; //contains related functions
...

ckr
31 May 2009, 7:11 PM
Hmm....
I guess not? :-?