This content has been marked as final. Show 3 replies
PaulH wrote:Is that all the class does? It just has that one method? And the method does nothing more than create a list of Integers corresponding to the last 5 years? If so, then I would probably not create a whole class just for that. And if that's not all it does, then it's hard to suggest a name without knowing more about what it really does.
Example: I have a class that calculate an range of year available to generate an report. This class return a list with Last 5 years from 2011... ex: in 2013 the list will return 2012, 2011 etc...
However, its name should come from a word or phrase that summarizes it responsibilities. The name ReportHelper that was already suggested may be appropriate, or perhaps ReportUtil. On the other hand, if the class isn't specifically just for reports, but does a handful of common tasks that deal with times and dates and calendars that could be used elsewhere in your app, then perhaps TimeUtil, or CalendarHelper would be appropriate. Or, if it is just the one method, then maybe that method should be moved to a ReportGenerator class, where calculating the list of years is one step in the task or generating a report.