I have a class that has a large method that requires many private methods. I think I want to extract these private methods into my own classes for one, because they contain business logic, and I think that they must be publicly available so that they can be tested per unit.
Here is a sample code:
public void handleRow(Object arg0) {
if (continueRunning){
hashData=(HashMap<String, Object>)arg0;
Long stdReportId = null;
Date effDate=null;
if (stdReportIds!=null){
stdReportId = stdReportIds[index];
}
if (effDates!=null){
effDate = effDates[index];
}
initAndPutPriceBrackets(hashData, stdReportId, effDate);
putBrand(hashData,stdReportId,formHandlerFor==0?true:useLiveForFirst);
putMultiLangDescriptions(hashData,stdReportId);
index++;
if (stdReportIds!=null && stdReportIds[0].equals(stdReportIds[1])){
continueRunning=false;
}
if (formHandlerFor==REPORTS){
putBeginDate(hashData,effDate,custId);
}
lstOfData.add(hashData);
}
}
What design model should be applied to this problem?
Jeune source
share