Re: A Change In Terminology: Monomorphic Objects. Polymorphic Objects
jaibuduvin@gmail.com (Le Chaud Lapin) wrote (abridged):
Yes, the PIMP idiom.
It's not the pImpl or "cheshire cat" idiom. In pImpl we have a wrapper
class that stores a pointer to the implementation class. That's not what's
happening in my example. MyDialog is not a wrapper; it's a client of
MySpecialControl. And MySpecialControl isn't a wrapper either. It is
merely forward-declared.
I say, if you have a class such that, perturbing it causes the
compilation of 1000's of files, then there are one of two
possibilities:
1. The included class is fundamental, and therefore the compilations
are warranted.
2. The organization of the code is poor, and should be restructured to
remove superfluous dependencies.
Indeed. And forward-declaring classes in headers is one way to remove a
superfluous dependency.
You seem to be claiming that if A depends on B and B depends on C, then A
should depend on C. This is simply not the case. In my view, OO is largely
about minimising dependencies. Clients of a class should not depend on the
class's implementation without good reason.
In fact, I seek every opportunity to create precisely that dependency
that you want to avoid.
You make your approach sound very alien to mine.
-- Dave Harris, Nottingham, UK.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]