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) work for a volunteer [was Re: digester data to XML]
Date Sun, 03 Feb 2002 14:20:57 GMT
On Thursday, January 31, 2002, at 07:56 PM, James Strachan wrote:

> Hi Robert

hi james

> ----- Original Message -----
> From: "robert burrell donkin" <robertdonkin@mac.com>
>> i still want to find a fix for that problem of circular references. i'd
>> really like to see what you think about the solution i've started on.
> (don'
>> t worry i haven't really done much work on it so it'll be no problem to
>> back it out again.)
>>
>> i think that fundamentally any solution comes around to being able to 
>> find
>> out which beans have been evaluated earlier (in the recursion) and not
>> evaluating any bean which has been evaluated earlier in the recursion. it
>> seems to me that the context is a good place to add new functionality
>> since it can be shared between different output implementations (i'm 
>> still
>> keen on that bean navigator you were talking about). so, the idea is that
>> to store an (optional) parent context in context. when you're evaluating
>> the next level in a recursion, rather than starting with a new context,
>> you start with a child context of the current level - and you check that
>> the bean you're about to recursively evaluate isn't already an ancester 
>> of
>> the current context.
>
> Sounds the right approach to me. Maybe just a Set of all beans traversed
> would do, then as the bean tree is walked duplicates can be ignored.

i've been thinking about this. maybe the right way to handle this would be 
by using IDs and IDREF's. betwixt could easily assign an ID to each 
element. when it came to a cyclic reference, it could then set the IDREF 
to point to the original.

what do you think?

- 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