On Wed, Apr 16, 2008 at 10:30 AM, Gerolf Seitz <[EMAIL PROTECTED]> wrote: > > > > I agree we should make this as simple as possible. > > We simply cannot take the short cut to XML on the business objects (like > > Roster) because this layer and the layer beneath (stanza layer) is unaware > > of XML. Only the next lower level (transport layer) is serializing. > > > > from looking at the class hierarchy, i don't think so. Stanza extends > XMLElement, so it does not only know about XML, it essentially IS XML ;) > also, StanzaBuilder is really only about building the XML structure > (addAttribute, startInnerElement, ...).
I admit and agree that it is very much sounding like XML, but there is an important difference: While a Stanza could be expressed with XML, you cannot put any XML into a Stanza. The parser shields us from all the XML which is not well-formed XMPP-XML. A Stanza might only contain well-formed XMPP-XML. This makes coding on the Stanza level a lot easier and more elegant. For example, you don't have to check all the way for your XML to contain comments which is illegal in XMPP-XML, because a Stanza object cannot contain comments (when coming out of the parser). Using attributes on objects like Roster is a great idea I would really like to see implemented. I would favor to take the XStream example as an inspiration for our own attributes. WDYT? Bernd --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
