October 2004
Intermediate to advanced
240 pages
6h 22m
English
Don’t be over-dependent: Don’t #include a definition when a forward declaration will do.
Don’t be co-dependent: Cyclic dependencies occur when two modules depend directly or indirectly on one another. A module is a cohesive unit of release (see page 103); modules that are interdependent are not really individual modules, but super-glued together into what’s really a larger module, a larger unit of release. Thus, cyclic dependencies work against modularity and are a bane of large projects. Avoid them.
Prefer forward declarations except where you really need a type’s definition. You need a full definition of a class C in two main cases:
• When you need to know ...