March 16th, 2009 3 comments
In most cases, no matter what area of software development you are involved in, you will need a functionality of cloning your objects. The .NET Framework provides you 3 ways of achieving your object copying goal:
- Implement the ICloneable interface, and develop cloning functionality manually for each class involved in your desired cloning.
- Serialize you object to binary stream and deserialize it utilizing BinaryFormatter and MemoryStream classes. In this case your classes will need to be Serializable.
- Clone using Reflections.