--- Vince Bonfanti <[EMAIL PROTECTED]> wrote:
>
> I'm not sure I understand what you mean by this. By
> "state" you mean the
> object attributes (instance variables). Wouldn't
> cloning an object merely
> copy the current state? Isn't this how
> Object.clone() works in Java--thus
> inherently supporting a way to "generically 'clone'
> an object in (a)
> meaningful way"?
Let's consider this problem in another way. An
object's state consists of its intrinsic attributes as
well as its relationships to other objects. If you
clone an object, should you clone its relationships as
well? If you clone a productive employee, will that
employee still be as useful if you don't clone all
his/her relationships (marriage, family, friends,
subordinates) as well -- but if you do clone its
relationships, you're likely to create other problems
(bigamy, 3 parent families, etc.)
Object attributes which are references are
relationships, and generic cloning will violate
relationship integrity. This is why the Object.clone()
method implementation is left up to you, not the JDK.
I-Lin Kuo
Macromedia CF5 Advanced Developer
Sun Certified Java 2 Programmer
__________________________________
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]