[JDEV] Re: jabber; what would you like to see?

Richard Dobson richard at dobson-i.net
Thu Sep 25 07:38:40 CDT 2003


> I agree very much - it is always a distinction between features and
> flexibility vs. potential exploits etc. : who said java, javascript, word
> macros etc...

Good

> However I do not agree with your point that jabber is already flexible
> enough due to its reliance on XML.
>
> XML is just a protocol for metatyping data structures. XML does not
> contain any logics, loop constructs nor control statements and certainly
> not any sort of mathematical manipulation.

No but XML doesnt need to be able to do mathematical manipulation in this
context, XML/Jabber are the building blocks we use to build protocols for
applications on top of. It seems from my point of view that you have a
misunderstanding about what jabber is and how it all works.

> This results in a rigid framework where one has to create external
> components for every damn little service one wishes to create ontop of the
> jabber server.

Whats wrong with that??? Thats how its supposed to be, and should stay IMO.

> Thats what Im searching for with respect to a solution - I dont care if it
> is  a scripting solution, a backend solution or something third; but
> adding some middleware (perl, python, ..., other high level language) to
> jabber would be really nice.
>
> Let me give just one more example, DJ Adams coffee machine check. Say Mr.
> Adams would like to get a statistical analysis of whom uses his external
> component.
>
> What is required would be that his external component puts a flag in a
> database. Then he should add a namespace via xdb in order to retrieve the
> stats and have an external component that catches this packet and does a
> SQL statement.

You problem seems to stem entirely from implementation problems in xdb
(which with the jabber2 server will no longer exist, so you shouldnt really
be building applications that rely on it), the problems you are experiencing
using it are not really to do with xml/jabber lacking extensibility.

> Lets assume this works so that I can say:
>
> <iq type="get">
> <query xmlns="coffee:stats"/>
> </iq>
>
> And the result being a top10 (its just bogus packets, which cant be
used...):
>
> <iq type="result">
> <item>
> <username>blabla</username>
> <visits>10</visits>
> </item>
> <item>
> <username>blabla</username>
> <visits>5</visits>
> </item>
> <item>
> <username>blabla</username>
> <visits>3</visits>
> </item>
> ....etc.
> </iq>
>
> Ok, lets say that now I want a top 20.
>
> In jabber what I must do now is to create a new namespace that expands to
> a SQL stament that fetches the 20 best.
>
> Now I want a top 100. Same story.
>
> What is missing? a method for passing data along with a iq-get packet:
>
> <iq type="get">
> <query xmlns="coffee:stats">
> <top>20</top>
> </query>
> </iq>

Whats wrong with doing it like this??? With a custom protocol handler or
service for coffee:stats (which is the way you should be doing it) there
would be no problem, this not working for you has nothing to do with the
protocol and everything to do with limitations in xdb.

> Such a packet is not allowed. The <top> section is simply chopped off...!
> Why? Because jabber was appearently not intended to anything but instant
> messenger.

Again thats just a limitation in xdb, its got nothing to do with the
protocol. It sounds like you are just passing the whole packet to xdb and
expecting it to process it and give you appropriate results, what you need
to do its handle this yourself in your application.

Out of interest how are you developing your system (what library, language
etc), as you seem to be blaming problems with your implementation on the
protocol when there is nothing wrong with it, give us a detailed
explaination of how you went about creating your system and we can help you
sort it without needing any silly scripting stuff added to the protocol.

> In the game I have done which uses jabber as XML socket server, I have
> some +20 different namespaces many of which have exactly the same function
> just different parameters.
>
> It might be me who is lame and doesnt understand how to use JEP 004 but I
> think many many developers out there have had similar problems - I know
> since I have had private questions from some 10 different persons asking
> how I have done the external component.

You just seem to be misunderstanding how things are working that is all.

Richard




More information about the JDev mailing list