commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertdon...@mac.com>
Subject Re: [Betwixt] Some ideas
Date Sat, 15 Jun 2002 11:13:20 GMT
hi Stephen

i've been having a think and i don't really see why we shouldn't get 
something along these lines in for the release. see in line for more...

On Friday, June 14, 2002, at 05:08 AM, James Strachan wrote:

> From: "Stephen Colebourne" <scolebourne@eurobell.co.uk>

>> 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.

this is an improvement and it should be quick and easy. i'll take a look 
at this.

>> 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.

i think i understand what it is you need but i'm not 100% sure. hopefully 
you'll correct me when if i've got it wrong...

as i see it, from a betwixt point of view there are two different bits


first bit is per bean ID control...

at the moment, you have a choice between having all elements with ID 
attributes or none. you'd like the ability to control which elements have 
IDs and which don't so that you can have some elements with IDs and some 
without. if a cycle occurred with a bean with an ID then an IDREF would be 
written. otherwise an exception would be thrown.

from a betwixt perspective, this information belongs in the XMLBeanInfo. 
the XMLIntospector could use a property to determine the default. giving 
the same functionality as at present.

in order to implement, we'd need to go through and alter the cyclic 
reference code. this isn't a massive change but needs to be done carefully.
  if necessary, this feature could be left until a 1,1 release.


the other bit is the interfaces...

(i need to check this but) i think that you can already custom betwixt so 
that you can set the ID from a property of the bean. so this is really 
adding another way to achieve something that can be done already (but that'
s not necessarily a bad thing). using interfaces is a bit against the 
betwixt philosophy but since i can see that some users will probably 
prefer them i have no great objections. (i don't know if other people 
would take different views on this.)

beans with this interface could be automatically marked as supporting IDs 
but the converse would not be the case. this shouldn't take a lot of work 
but would rely on the first bit.

- robert


--
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