We use apache commons beanutils library in our code. It removes a lot of plumbing from the code. If you do not know about BeanUtils take a look here. There is a method in BeanUtils which allows you to copy one Java bean to another if they have the same properties The name of the method is copy and the method takes 2 beans, the source bean and the destination bean. This got me thinking as to whether this name is apt for this method? When you see the method name there is no way to infer as to which argument is the source and which is the destination other than popping up the java doc and seeing it. Would a name of copySourceDest or copyDestSource be more intuitive than just the name copy?

Advertisements