views:

283

answers:

7

I have a class that implements ICloneable. I need it to have a backup of an entity, so when the user clicks cancel, etc., I have all values asides.

I want to create in the cloneable class another function, that clones in, i.e. receives another class of the same type and uses the same clone but to the opposite direction while the other members are still the same, i.e. the instance is the same.

How should I name that function?

I would say my question is what's the opposite of 'Clone' something like 'swallow' etc., you're the expert, I don't know English.

Thanks

+10  A: 

How about Merge?

klausbyskov
Yes I like it. let's see what other users say, I will probably use this one.
Shimmy
Seems abiguous. Does a.merge(b) copy from a to b, or from b to a?
BlueRaja - Danny Pflughoeft
@BlueRaja's got a good point. `MergeTo` would be better and follow the pattern of existing `CopyTo` functions
Michael Haren
Sounds more like he wants a.MergeFrom(b)
BlueRaja - Danny Pflughoeft
A: 

CopyFrom?

......

helios
+3  A: 

Restore, I'd say. The backup/restore metaphor applies.

Seva Alekseyev
A: 

ThereCanBeOnlyOne()?

eduffy
It's called "unique", and that's not what the asker wants.
KennyTM
A: 

In Java, we have String.intern() to do as you want. So maybe Interner makes sense. Guava will also use this term, I believe.

nanda
A: 

Compose may also work for the opposite of clone.

JB King
A: 

What about Absorb?

Daniel Pryden