copy method for an exist object

copy and deep copy for an exist object, when extend an object, it will
be very useful