Requirements: I'm transforming images from our system to PNG format. The image transformation should fail whenever the image is of CMYK encoding or dimension is less than 500*500 (some more criteria). After each run an email should be sent with a report. The functionality is working fine and I'm refactoring my report builder code. I'm basically following a builder pattern to build the report. Following is a snippet of my code:
ImageProcessor:
public String processImage(File imageToProcess, String name, String temp_location, String boxLocation, String id, ReportContent missingStyle, ReportContent missingImage, ReportContent unSupportedEncoding, ReportContent imageSize, List<String> missingStyleNames, List<String> missingImageNames, List<String> unSupportedEncodingNames, List<String> imageSizeNames) {
// The code process an image and if an image fails then it add that failed image to appropriate report content object.
}
I'm calling the above method from a service where I'm creating instances of ReportContent and Lists. I want to reduce the number of parameters being passed to this method. One option is instead of individual ReportContent, I can pass a list of Report Content. The problem with this approach is I'm calling some other methods also from proessImage method so I'll need to pass that entire list again to that method. I want to make the code more readable and reduce the complexity. I'd be happy to provide more code snippts if needed.
Any suggestions?
Aucun commentaire:
Enregistrer un commentaire