[jdev] Re: design of library APIs
Craig Hollabaugh
craig at hollabaugh.com
Mon Sep 13 15:09:35 CDT 2004
You may to consider using an existing XML library for the dom part (or
at least its interface). I've been coding a lot in python and have to
keep both the python jabber dom and libxml2 dom docs open at the same
time because I can't remember the method calls. For example,
jabber node.getAttr(attr)
libxml2 node.prop(attr)
are the same method to get the value of an element attribute.
jabber.node != libxml2.node either, I have to convert between these
frequently.
I'm not saying to use libxml2, I'm saying seriously consider using some
existing xml lib for rudy rather than writing your own minidom for xmpp
communications.
Craig
On Mon, 2004-09-13 at 13:53, Pete Birkinshaw wrote:
> jdev-request at jabber.org wrote:
> >
> > Today's Topics:
> >
> > 1. design of library APIs (Lucas Nussbaum)
> > Hi,
> >
> > I am considering writing yet another library for Jabber, this one in
> > Ruby. I'd like to allow easy migration from other libraries, so I'd like
> > to know which library I should use as an example.
> >
> > Which are the libraries known to have a good API design, for both client
> > and component, and low-level and high-level handling of the protocol ?
> >
> > Thank you,
>
> Hi,
>
> Jabber::Connection, (Perl) appeals to me for server side stuff. It's
> very light: it handles the connections and callbacks, and everything
> else is done by processing the XML. Jabber/XMPP content is really just
> XML, after all. Jabber::Connection comes with Jabber::NodeFactory, which
> is a nice little XML library.
>
> If you wanted to write a more complete API you could always layer it
> over a simple library like this.
>
> Jabber::Connection hasn't been updated for a while, and you'll need
> the latest version from here:
> <http://www.pipetree.com/jabber/jabberconnection/>
>
> I'm not sure if one Library/API will be suitable for both server-side
> and client-side programs. For clients I actually prefer Net::Jabber,
> because with clients there's more non-protocol work to do, and
> Net::Jabber lets me get on with that.
>
> Pete.
--
------------------------------------------------------------
Dr. Craig Hollabaugh, craig at hollabaugh.com, 970 325 0509
Author of Embedded Linux: Hardware, Software and Interfacing
www.embeddedlinuxinterfacing.com
More information about the JDev
mailing list