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
compress
method that takes in an input video of typeRawVideo
and returns an output video of typeCompressedVideo
). - VideoSplitter (with a
split
method that takes in an input video of typeRawVideo
and returns a vector of 2 output videos, each of typeRawVideo
). - VideoIndexer (with an
index
method that takes in an input video of typeRawVideo
and returns a video index of typeVideoIndex
).
I find myself instantiating each class just to make calls like VideoCompressor.compress(...)
, VideoSplitter.split(...)
, VideoIndexer.index(...)
.
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?