Re: Specific Cloning Question
- From: "Alex" <alexander.webb@xxxxxxxxx>
- Date: 22 Sep 2006 03:14:21 -0700
Thomas Weidenfeller wrote:
Alex wrote:
I realise it is hard to help without seeing the code
It is actually a waste of our time.
but I am looking
for general advice on whether cloning is a sensible way to achieve what
I want.
No, it is not.
How do I know? I don't, I am just guessing, because you haven't shown us
how you do things, haven't given us important information like the size
of the tree or the complexity of the operations you intend to do on the
clone and you eventually want to undo.
The reason why I still say it is not a sensible way is because you have
not devised (or not told us) a sensible way of what should happen if you
are satisfied with the changes to the clone and you decide to keep the
cloned tree. Then you might have to "magically" change references to the
old tree all over your program. Might, because we don't know your
program. That's manageable with another level of indirection, but
without you mentioning it, and without seeing your code I simply state
cloning is not a good idea in this case.
If so...how do you go about it? If you think you can help I am
happy to send you my code but it seems silly to post it all here as
it's quite big.
If you can't be bothered to invest some time to cut down your code to
some useful demo of the problem, and if you can't be bothered to even
copy the exception error messages verbatim, why should we invest our
time to second-guess? Is your time more valuable than ours?
/Thomas
--
The comp.lang.java.gui FAQ:
http://gd.tuwien.ac.at/faqs/faqs-hierarchy/comp/comp.lang.java.gui/
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
Clearly I don't think my time is more valuable and you are perfectly
welcome to not spent time replying. My point was simply that if someone
has the time to help me then I would be able to provide more in depth
detail. It seems rather unhelpful and rude to respond in this way.
In answer to some of your questions:
1) Size: The number of leaves in the tree may vary between small (i.e
3/4 to possibly quite large 20+)
2) Operations: The sort of operations is not clear cut yet. Probably
there will be subtree prune and regraft type operations and simple
changing of the lengths of branches within the tree
3) If I am satisfied with the new tree can I not simple set the old
tree equal to the new tree?
The reason I have not managed to cut down the program is that I am not
sure how to do that without losing the complexity that is causing the
problem. I have made smaller versions of things and tried cloning
things that contain lists of references but I don't seem to get the
problems in these oversimplified examples.
Anyway, if your time is too valuable there is no pressure on you or
anyone else to help or to even read this. However, I fail to see that
there is much harm in asking, just in case someone out there knows how
to help and has some time to do it.
Thanks,
Alex
.
- Follow-Ups:
- Re: Specific Cloning Question
- From: Oliver Wong
- Re: Specific Cloning Question
- References:
- Specific Cloning Question
- From: Alex
- Re: Specific Cloning Question
- From: Thomas Weidenfeller
- Specific Cloning Question
- Prev by Date: Re: package private problem
- Next by Date: Re: Specific Cloning Question
- Previous by thread: Re: Specific Cloning Question
- Next by thread: Re: Specific Cloning Question
- Index(es):
Relevant Pages
|