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?
Hey
Why do we need such lengthy method names when the standard practice is , “when we have 2 arguments, copy the contents of the right argument to the left”. Isnt it what they are doing?
copyProperties(java.lang.Object dest, java.lang.Object orig)
If you check the the copy method of collections utils,
copy(List dest, List src) even they are doing the same thing.
So as long the standard convention is followed, dont you think there is no need to have such lengthy method names?