Distribution of many small classes

Posted by Moo-Juice on Stack Overflow See other posts from Stack Overflow or by Moo-Juice
Published on 2011-01-04T23:49:27Z Indexed on 2011/01/04 23:54 UTC
Read the original article Hit count: 133

Hi All,

I have a base class called EventArgs. Derived from this are many, many specializations that represent event arguments for a particular kind of event. Consumers of these events may need some, many, or very few of these argument classes.

My question is, would you provide a header file for each type (e.g, 50+ header files for the varying ones), would you try to group them in to families and have a 'common' header file for those, or would you throw caution to the window and throw them in to one easy-of-use header file that can just be included?

Another approach might be to have 50 header files, and then I could introduce some "family" header files that included particular ones. Not sure about the naming conventions for these kinds of things so it is obvious what is where.

I know there may not be a hard and fast rule, but wondering what other developers have done when they find themselves writing many little classes.

Thanks in advance.

© Stack Overflow or respective owner

Related posts about c++

Related posts about include