Ticket #6033 (closed enhancement: fixed)
[patch][cla] Should DojoX RPC allow for "namespaced" method call syntax?
| Reported by: | guest | Owned by: | kriszyp |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.2 |
| Component: | RPC | Version: | 1.0 |
| Severity: | normal | Keywords: | |
| Cc: | revin@… |
Description (last modified by kriszyp) (diff)
Some APIs expose their methods in a flat list of functions, others in (sometimes nested) namespaces. For an example of the latter, Flickr's API has methods like flickr.auth.checkToken, flickr.contacts.getList, etc... To get those to work in a dojox.rpc.Service, we have to rename the RPC methods to something more JS-friendly, like authCheckToken, contactsGetList, and so forth. It might be kind of nice to allow for the following style of code:
var flickr = new dojox.rpc.Service("path/to/flickr.smd");
flickr.auth.checkToken({...}).addCallback(...);
I have a small patch to create a dummy object chain given a dot-separated SMD service name, which basically does nothing but allow for this kind of syntactic sugar, if anyone thinks that might be welcome.