Copy with deepCopy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Copy with deepCopy

Ulrich Hermann
Hello,

I am new with Visualwork. I want copy a complet object with deepCopy.  
I used it with Squeak.

My question:
        Is there no deepCopy within Visualworks ?
         How to make a real copy with VW.

Thanks and regards
Ulli

Reply | Threaded
Open this post in threaded view
|

Re: Copy with deepCopy

Mathieu SUEN
you have Object>>#dcopy
but you have nice way to control the "deepness" of your copy
look at Object>>#copy

And you will learn that if you redefine postCopy you can control  
witch properties you want to copy or not.
Look at  some example of postCopy ( ClassOrganizer, Dictionary,  
IdentityDictionary...)

        Math

On Mar 17, 2007, at 11:37 PM, Ulrich Hermann wrote:

> Hello,
>
> I am new with Visualwork. I want copy a complet object with  
> deepCopy. I used it with Squeak.
>
> My question:
> Is there no deepCopy within Visualworks ?
>         How to make a real copy with VW.
>
> Thanks and regards
> Ulli

Reply | Threaded
Open this post in threaded view
|

Re: Copy with deepCopy

jtuchel
In reply to this post by Ulrich Hermann
Ulrich Hermann schrieb:

> Hello,
>
> I am new with Visualwork. I want copy a complet object with deepCopy. I
> used it with Squeak.
>
> My question:
>     Is there no deepCopy within Visualworks ?
>         How to make a real copy with VW.
>
> Thanks and regards
> Ulli

Have a look at implementors of #postCopy. This might be what your are
looking for..

Reply | Threaded
Open this post in threaded view
|

Re: Copy with deepCopy

Denis Johnson
In reply to this post by Ulrich Hermann
I remember someone once posted on comp.lang.smalltalk regarding a deep
copy framework where one could control the depth. I'm sorry by I can't
remember whom to attribute it to. I suggest you check the archives.

However for a quick and dirty deep copy in VW, you can use BOSS to
write out your root object to to a stream and read it back in. You
cannot control the depth of the copy and there are some restrictions
as to some objects like Windows, but BOSS fully handles recursive
references and the like and you will get back a complete copy with no
aliased references.

hth, cheers Denis

On 3/18/07, Ulrich Hermann <[hidden email]> wrote:

> Hello,
>
> I am new with Visualwork. I want copy a complet object with deepCopy.
> I used it with Squeak.
>
> My question:
>         Is there no deepCopy within Visualworks ?
>          How to make a real copy with VW.
>
> Thanks and regards
> Ulli
>
>

Reply | Threaded
Open this post in threaded view
|

RE: Copy with deepCopy

Paul Baumann
Niall Ross probably posted to comp.lang.smalltalk. Niall created a deep
comparision program pattered after a deep copy framework that I released
in '98. Niall's paper can be found here:

http://www.esug.org/data/ESUG2002/xplegacy.pdf

The Custom Deep Copy Framework can be found here:

http://st-www.cs.uiuc.edu/new-uploads.html

With this framework you can define multiple depth rules. Recursive
references are handled fine. It would be faster than serialization-based
deep copies, but those are certainly an option.

Regards,

Paul Baumann


-----Original Message-----
From: Denis Johnson [mailto:[hidden email]]
Sent: Wednesday, March 21, 2007 10:36 PM
To: [hidden email]
Cc: Ulrich Hermann
Subject: Re: Copy with deepCopy

I remember someone once posted on comp.lang.smalltalk regarding a deep
copy framework where one could control the depth. I'm sorry by I can't
remember whom to attribute it to. I suggest you check the archives.

However for a quick and dirty deep copy in VW, you can use BOSS to write
out your root object to to a stream and read it back in. You cannot
control the depth of the copy and there are some restrictions as to some
objects like Windows, but BOSS fully handles recursive references and
the like and you will get back a complete copy with no aliased
references.

hth, cheers Denis

On 3/18/07, Ulrich Hermann <[hidden email]> wrote:

> Hello,
>
> I am new with Visualwork. I want copy a complet object with deepCopy.
> I used it with Squeak.
>
> My question:
>         Is there no deepCopy within Visualworks ?
>          How to make a real copy with VW.
>
> Thanks and regards
> Ulli
>
>
 
 
 
--------------------------------------------------------
This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange, Inc. (ICE), its subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.  
 

Reply | Threaded
Open this post in threaded view
|

RE: Copy with deepCopy

Stew MacLean
In reply to this post by Ulrich Hermann
Hi Denis,

To save you filing in, please find attached a parcelled version of
Paul's framework. I have made some minor changes and fixed a bug. I use
this to copy sub object graphs as part of a BOSS based persistence
framework. Please refer to the CopyStrategy>>documentation method.

Kudos to Paul for providing such a useful framework!

Cheers,

Stewart

PS Paul, sorry it's taken so long to provide some feedback.

>-----Original Message-----
>From: Paul Baumann [mailto:[hidden email]]
>Sent: 23 March 2007 1:06 a.m.
>To: Denis Johnson; [hidden email]
>Cc: Ulrich Hermann
>Subject: RE: Copy with deepCopy
>
>Niall Ross probably posted to comp.lang.smalltalk. Niall created a deep
>comparision program pattered after a deep copy framework that I
released

>in '98. Niall's paper can be found here:
>
>http://www.esug.org/data/ESUG2002/xplegacy.pdf
>
>The Custom Deep Copy Framework can be found here:
>
>http://st-www.cs.uiuc.edu/new-uploads.html
>
>With this framework you can define multiple depth rules. Recursive
>references are handled fine. It would be faster than
serialization-based

>deep copies, but those are certainly an option.
>
>Regards,
>
>Paul Baumann
>
>
>-----Original Message-----
>From: Denis Johnson [mailto:[hidden email]]
>Sent: Wednesday, March 21, 2007 10:36 PM
>To: [hidden email]
>Cc: Ulrich Hermann
>Subject: Re: Copy with deepCopy
>
>I remember someone once posted on comp.lang.smalltalk regarding a deep
>copy framework where one could control the depth. I'm sorry by I can't
>remember whom to attribute it to. I suggest you check the archives.
>
>However for a quick and dirty deep copy in VW, you can use BOSS to
write
>out your root object to to a stream and read it back in. You cannot
>control the depth of the copy and there are some restrictions as to
some

>objects like Windows, but BOSS fully handles recursive references and
>the like and you will get back a complete copy with no aliased
>references.
>
>hth, cheers Denis
>
>On 3/18/07, Ulrich Hermann <[hidden email]> wrote:
>> Hello,
>>
>> I am new with Visualwork. I want copy a complet object with deepCopy.
>> I used it with Squeak.
>>
>> My question:
>>         Is there no deepCopy within Visualworks ?
>>          How to make a real copy with VW.
>>
>> Thanks and regards
>> Ulli
>>
>>
>
>
>
>--------------------------------------------------------
>This message may contain confidential information and is intended for
>specific recipients unless explicitly noted otherwise. If you have
reason
>to believe you are not an intended recipient of this message, please
delete
>it and notify the sender. This message may not represent the opinion of
>IntercontinentalExchange, Inc. (ICE), its subsidiaries or affiliates,
and
>does not constitute a contract or guarantee. Unencrypted electronic
mail is
>not secure and the recipient of this message is expected to provide
>safeguards from viruses and pursue alternate means of communication
where
>privacy or a binding message is desired.
>


SIMDeepCopy.pst (41K) Download Attachment
SIMDeepCopy.pcl (6K) Download Attachment