mardi 10 mai 2016

Software design: Too many classes?

I'm a layperson in terms of software design. I'm facing an "issue" that perhaps is solved by some well known technique/idiom/pattern which I would like to be told about.

I have an abstract base class basically defining one pure virtual member function and little else. Then I have several classes deriving from this one and overriding the said virtual function. I have now half a dozen such classes and the number is growing. The classes have just a few data members (very few, like a couple of doubles or that plus a function pointer) and they differ mainly by the way they perform a very short computation. I wonder if this indicates a bad design and is better dealt in some other way.

If appropriate, could someone point me at a relevant design pattern or idiom I should know of. Thanks.

Aucun commentaire:

Enregistrer un commentaire