ICloneable

Chapter 3: Parameterized typing with generics: 3.5.2

Created: 2/22/2008
Last updated: 2/22/2008

ICloneable is effectively a useless interface, because it doesn't indicate whether the copy should be deep or shallow. Even if the interface were separated into two, depending on whether or not you wanted the copy to be deep, it still wouldn't be terribly clear. Just how deep should a deep copy be? Just how shallow should a shallow copy be?

In many ways, the difficulties in expressing copy depth are similar to the difficulties in expressing const semantics.