I do a lot of flat-file processing to extract data. The file "formats" are very unique and each file format requires a lot of format-specific code. Sometimes, the parsing code needs to maintain a lot of state while the file is being read. I've used something like this "pattern" at times:
parser = New FileTypeAParser(filename) parser.ParseEnterFile data = parser.ParsedData
Or, consider a class that factors large numbers. For efficiency reason, upon being instantiated, the class would internally generate and cache list a primes. It would then be called many times with different numbers like this:
factors = factorizer.Factor(veryLargeNumber)
The adage is Class names should be nouns; method names should be verbs. Is it a code smell to name and use classes in the way shown in the examples? If so, how do I refactor the examples to deodorize them and remove the code smell?
Based on the comments, I now realize that I am using nouns. After putting more thought into it, I realized that my concern is that these classes very verb-like in substance and in name. Is this something to be concerned about?