jrvbdeveloper
Member
- Joined
- Jul 15, 2007
- Messages
- 17
- Programming Experience
- Beginner
Hi,
I was wondering what is best practice with regards to cloning objects, i.e. should the calling routine clone the object, or should it be cloned where it exists?
For example, if you are accessing a property, should the property be cloning the object or should you be cloning it?
Similarly, what if you are creating a new instance of a class, and passing it some objects. Should you clone the objects then pass them, or should the class be cloning the objects itself?
Thanks in advance!
I was wondering what is best practice with regards to cloning objects, i.e. should the calling routine clone the object, or should it be cloned where it exists?
For example, if you are accessing a property, should the property be cloning the object or should you be cloning it?
Similarly, what if you are creating a new instance of a class, and passing it some objects. Should you clone the objects then pass them, or should the class be cloning the objects itself?
Thanks in advance!