In a large code base, what is a good practice between: Updating class properties inside the method vs. returning a value from the method and updating the property in the place where the call to the method was. Example 1: Updating class properties inside the methoddef sendFileToS3OrFileServer(Request request) {  if (settings.isS3())     request.s3Url = helper.uploadToS3(request.absoluteFilePath)  else if (settings.isFileServer())     request.fileServerUrl = helper.uploadToFileServer(request.absoluteFilePath)}//call the method abovesendFileToS3OrFileServer(request)Example 2: Returning from the method instead of updating inside the methodString sendFileToS3OrFileServer(Request request) {  if (settings.isS3())     return helper.uploadToS3(request.absoluteFilePath)  else if (settings.isFileServer())     return helper.uploadToFileServer(request.absoluteFilePath)}//call the method aboverequest.commonS3OrFileServerUrl = sendFileToS3OrFileServer(request)
Updating class property inside the method vs. returning a value from the method
java;programming practices;readability;groovy