Java , wrapper object, , Transfer Object, .
Modifying parameters are also a very common method. You can see examples in the JDK itself, for example Collections.sort (List of lists) or InputStream.read (byte []) .
It is also common when working with persistent objects, for example, in the code snippet below
public void updateTrackingFields(Trackable trackable, String user) {
trackable.setChangedBy(user);
trackable.setChangedTime(System.currentTimeMillis());
}
So, I believe that there can be much worse design decisions than these two.
EDIT: Added an example of persistent objects.
source
share