[jdev] Jabber-RPC versus iq/query?
us at die-horde.de
Thu Mar 4 10:37:46 CST 2004
Christopher Zorn wrote:
>On Thu, Mar 04, 2004 at 09:19:55AM -0500, Jason McIntosh wrote:
>>I have a question of Jabber programming style. The Jabber-based project
>>I'm currently working on (http://volity.org) defines a handful of
>>different Jabber-RPC requests that its clients and servers (all of whom
>>are simply users, from Jabber's POV) can pass around, forming a
>>higher-level protocol that rides atop Jabber/XMPP.
>>However, since learning more about the core Jabber protocol (I admit
>>that I started by learning the current MUC and disco JEPs in detail,
>>and then worked my way inwards thereafter), I'm starting to wonder if
>>some or perhaps all of these RPC requests should instead happen through
>>the standard iq/query elements, using namespaces unique to our project.
>>Many of these project-specific functions are literally information
>>queries, while others request that the receiving entity attempt to
>>perform some action on its end. My gut reaction would be to assign the
>>latter sorts of activities to RPC, but I do notice that Jabber has
>>things like in-band registration happen through iq elements as well.
>>So I could do continue doing everything specific to our project via
>>RPC, and everything would more or less work fine, but I have to wonder
>>if it's "more correct" and perhaps even practically better to use query
>>elements with proper namespaces when possible (in which case I may end
>>up dropping RPC altogether). Is there a general style guideline for
>>when an application using Jabber/XMPP as its transport should favor
>>Jabber-RPC over <iq><query xmlns="http://my.namespace.com/foo"/></iq>
>>elements, or vice-versa?
>I have had similar questions but never really asked anyone.
>Anyway, I have a project that we started off defining our own namespace and
>then decided to switch to RPC. That decision was made because it was
>something that was supported by jabber with a JEP and it would be easy
>to do some sort of http xmlrpc to jabber xmlrpc if needed.
>I am wondering what others think about this too. Should someone just use
>xmlrpc to do remote procedure calls or make up there own namespace?
imo it's really up to you and your application whether you choose to
create your own namespace or you decide to use xmlrpc librarys. If your
application does not need the overhead of "another" library in the
application and the procedure calls+transmitted informations are not too
complex, i'd create my own namespace.
but if you see reusability, since your data is more of general nature,
and you decide to create a new namespace i'd document the namespace well
and maybe some standard emerges sooner or later from it.
for example i added a chessboard namespace to enigma, xmlrpc would have
bloated the client even more.
hope this helps,
>> Jason McIntosh jmac at jmac.org
>>Somerville, MA, USA http://www.jmac.org
>>jdev mailing list
>>jdev at jabber.org
>jdev mailing list
>jdev at jabber.org
More information about the JDev