commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james_strac...@yahoo.co.uk>
Subject Re: [Betwixt] Some ideas
Date Fri, 14 Jun 2002 04:08:39 GMT
Hi Stephen

From: "Stephen Colebourne" <scolebourne@eurobell.co.uk>
> Hi,
> A while back I looked at using Betwixt for my Bean to XML generation
(Joda).
> In the end I rolled my own (time pressure was a factor), but I would still
> like to refactor Joda to use betwixt if possible in the longer term.
>
> As you are talking about a 1.0 release, I thought I'd jot down some of the
> ideas which I implemented in my Bean to XML code that aren't (yet) in
> betwixt. Maybe some might make it to the todo list?
>
> 1) SAX outputter - I believe this is on the todo list already ;-)

:-)

> 2) ID's as Strings - Betwixt uses ints for it's ID/IDREF values (to handle
> recursion). I needed Strings, to allow for more complex generated ids
> including IP ref etc. This would be a faily easy change to make, but after
a
> release it would break backwards compatability?

This sounds cool I think. The use of ID/IDREF is optional anyways so it
shouldn't break anything.

> 3) ID's controlled on a per object basis - I created an Identifiable
> interface with getIdentifier and setIdentifier methods. Those beans which
> implemented it outputted an ID/IDREF. Those which didn't implement it were
> output directly, with the potential for (the exception case) recursion.

Not totallyl sure how this would work but it sounds very reasonable. Maybe
registering some kind of Resolver to lookup beans for some kind of ID;
though you can use straight Digester code for that too.


> 4) Subclass handling - When I last looked, I could find no automatic
> handling of class hierarchies. For example, the automatic generation of a
> type attribute if the class being output is a subclass of that expected.

Agreed - this would be nice.

> 5) End of  line handling - I have read in the JDOM source code that the
end
> of line in XML documents must be \n on all systems. So should betwixt have
> the setEndOfLine() method on BeanWriter?

Agreed. Yes "\n" is the default for XML (its like that in dom4j too ;-).

James


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message