C# Object Cloning Machinery
March 16th, 2009
3 comments
Introduction
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.
Attached Files:
- Object Cloner Demo
Screen shot of C# Object Cloner usage demo application.
- Binary of C# Object Cloner
Demo application for C# Object Cloner.
- Source of C# Object Cloner
Includes source code and demo application for C# Object Cloner.