Ticket #6033 (closed enhancement: fixed)

Opened 9 months ago

Last modified 5 months ago

[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.

Attachments

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

Change History

Changed 9 months ago by guest

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

Changed 9 months ago by dylan

  • summary changed from Should DojoX RPC allow for "namespaced" method call syntax? to [patch][cla] Should DojoX RPC allow for "namespaced" method call syntax?

Changed 9 months ago by dylan

  • milestone set to 1.1

Changed 9 months ago by dmachi

  • milestone changed from 1.1 to 1.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.

Changed 5 months ago by kriszyp

  • owner changed from dmachi to kriszyp
  • description modified (diff)

Changed 5 months 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.

Changed 5 months ago by kriszyp

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.