Opened 11 years ago

Closed 11 years ago

Last modified 9 years ago

#6033 closed enhancement (fixed)

[patch][cla] Should DojoX RPC allow for "namespaced" method call syntax?

Reported by: guest Owned by: Kris Zyp
Priority: high Milestone: 1.2
Component: RPC Version: 1.0
Keywords: Cc: revin@…
Blocked By: Blocking:

Description (last modified by kriszyp)

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.

Attachments (1)

dojox-rpc-method-namespacing.patch (656 bytes) - added by guest 11 years ago.
Patch to create "namespacing" via a dummy object chain in RPC objects. Written and submitted by Revin Guillen, CLA on file.

Download all attachments as: .zip

Change History (8)

Changed 11 years ago by guest

Patch to create "namespacing" via a dummy object chain in RPC objects. Written and submitted by Revin Guillen, CLA on file.

comment:1 Changed 11 years ago by dylan

Summary: Should DojoX RPC allow for "namespaced" method call syntax?[patch][cla] Should DojoX RPC allow for "namespaced" method call syntax?

comment:2 Changed 11 years ago by dylan

Milestone: 1.1

comment:3 Changed 11 years ago by Dustin Machi

Milestone: 1.11.2

need to take a look closer at this one and see how it fits with the smd we have...we should incorporate it there first.

comment:4 Changed 11 years ago by kriszyp

Description: modified (diff)
Owner: changed from Dustin Machi to kriszyp

comment:5 Changed 11 years ago by kriszyp

I looked at this patch and it doesn't affect the SMD spec at all. I think this is a really useful patch, and I actually have code that would benefit from it as well. I am going to go ahead and commit this patch unless someone objects.

comment:6 Changed 11 years ago by kriszyp

Resolution: fixed
Status: newclosed

comment:7 Changed 9 years ago by bill

Owner: changed from kriszyp to Kris Zyp
Note: See TracTickets for help on using tickets.