Open nicholas22 opened 11 years ago
From what I can tell, this code is supposed to perform a shallow copy and not a deep copy. Three ideas come to mind:
What do you prefer?
Yes the shallowness is for the first version ;) Leaning towards the factory method, for ease of subclassing etc.
Another case today where boilerplate was used to clone a simple POJO. This must be a useful use-case for lots of users...
A nice addition to this already fantastic library is a way to do some boilerplate copying from one object's POJO properties to another. At the moment I've rolled out a very simple custom copier which uses reflection, but this is clearly something that can be made to perform much faster if done statically (at compile time).
A classic use-case would be when needing an object pool, or for re-usable pre-allocated data buffering techniques.
Regards, Nik