Avoid the overhead of large numbers of very similar classes with the Flyweight pattern. Learn how to recognize instances that are fundamentally the same except for a few parameters, move those variables outside the class instance, and pass them in as part of a method call. There is more development articles for C, C++, Java etc to read, here.