hi,

On Fri, 31 Jan 2003 16:02:49 +1100, [EMAIL PROTECTED] said:
> 
> private void setTopParent(TopLevelParent topParent) {
>    this.parent = topParent.getComponent();
> }
> 
> 
> should do what you need ;)

ok, it does not :) unfortunately the call sequence is:

- nestedChild.setParent( toplevel )
- nested.setParent( toplevel )
- toplevel.setChild( nested )

so, at the point when the nestedChild's parent relationship is
estabilished, the toplevel object's downward relationships are not
established yet.

furthermore this whole thing makes things uglier, since as far the object
model is concerned, a child now needs to have dependencies on it's
toplevel parent (but this relationship might not even be fixed). also,
due the the quirk i described above, the nested child would need to keep
a reference to the toplevel object, so it can do late binding...

alltogether, i think the more useful behavior for composite-element
parents' would be setting the immediate parent. perhaps make it an
option... or pick based on the class specified, eg. <parent name="foo"
class="foo.bar.Baz"/>.

best regards,
    viktor

-- 
http://fastmail.fm - Does exactly what it says on the tin


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Reply via email to