I am currently working on a software project that performs compression and indexing on video surveillance footage. The compression works by splitting background and foreground objects, then saving the background as a static image, and the foreground as a sprite.
Recently, I have embarked on reviewing some of the classes that I have designed for the project.
I noticed that there are many classes that only have a single public method. Some of these classes are:
- VideoCompressor (with a
compressmethod that takes in an input video of type
RawVideoand returns an output video of type
- VideoSplitter (with a
splitmethod that takes in an input video of type
RawVideoand returns a vector of 2 output videos, each of type
- VideoIndexer (with an
indexmethod that takes in an input video of type
RawVideoand returns a video index of type
I find myself instantiating each class just to make calls like
On the surface, I do think the class names are sufficiently descriptive of their intended function, and they are actually nouns. Correspondingly, their methods are also verbs.
Is this actually a problem?