Hi!

I've got some ideas floating around I'd like to discuss with you.


XMPP Stanza Inspector.

Sometimes it would be really good to know what exactly goes over the wire
(excluding the encryption of course). What I'm thinking about is some kind of
pluggable Stanza Inspector that lets us see what stanzas are sent and
inject/modify them as they pass. A metaphor could be a moderator of a
mailing-list. I don't think it's much effort to do, but the usefulness of such
a component is quite limited (debugging).


Templates.

Stanzas in Vysper are built using the StanzaBuilder which works similarly to
the StringBuilder. We add elements and attributes onto a stack. What about
using templates instead of a programmatic approach? I think using templates we
could enforce certain restrictions (that is, force attributes directly in the
template if the spec requires them etc.). Additionally I think templates could
be pluggable too. For example an publish action includes an item element, so
does a notification and a response for the request for all items. Using
templates such nestings *could* be done easier (and less error prone) than
with StanzaBuilder.  Of course good abstractions/generalisations with
StanzaBuilder work well too, yet I think templates are even easier to maintain.


Validating Streams.

The XMPP specifications and XEP extension specifications include XML Schema
definitions which could be used to validate a stanza-stream on the fly (which
is one big XML "file", essentially). If we configure our XML parser to be
validating with these schema files, we'd have a very rigorous error detection
in terms of "correct Stanza syntax". To check whether a request is semantically
invalid is still up to our code, but catching the easy ones early seems to be a
good thing to me. Dealing with malicious and misbehaving clients starts here, I
think.


There is no immediate need to do any of this right now (if there ever will be
one), but discussing it and hearing more input would be nice.

Cheers,
Michael

Reply via email to