I meant a representation of the object's internal state that can't be
viewed by anything except the object itself.  In Java you'd use an
inner class with private members, CF has no such facilities.

If an object's functionality depends on it's ethereal state, then that
state isn't really ethereal, is it?  For example, if an object
performs caching, that cache is ethereal state.  You don't need it in
the cloned object; the clone can just create an empty cache and start
from there.

The reason for not passing the whole variables struct is that that
contains the 'this' scope and all the CFC methods as well as instance
data.  That's the reason for the careful partitioning of instance
state into the 'my' or 'instance' subscope.  If you're designed your
internal state storage correctly, you should be able to create an
exact duplicate (a clone) simply by initializing the new object and
duplicating the source object's 'my' subscope into it.  Note that that
gets messier as you deal with composition; but most of the time, the
composited objects are ignored and recreated in the new object based
on the "real" state.

cheers,
barneyb

On 9/26/05, Nando <[EMAIL PROTECTED]> wrote:
> i was wondering what you meant by "an opaque
> representation of the object's internal state"
>
> ;)
>
> great discussion! although i have to say that the example of the clone
> function wouldn't work in all cases. if an object's functionality depends on
> it's "ethereal state", then you'd need more than  variables.my or
> variables.instance.
>
> so maybe a getClone() and setClone() in the object you'd want to be able to
> clone would be needed that returns and accepts the whole variables struct
> within an object.
>
> ?
>

--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 100 invites.


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


Reply via email to