Large components can be broken up into many .cc files to improve
compiler and linker efficiency.
(On many systems, code residing in a library originating in one file
is linked in on an "all-or-none" basis.
So a single large file containing unrelated routines can cause code
bloat.)
Put classes with their friend classes and functions in the same component.
- Prevents other components from violating encapsulation by defining
local versions of friends.
- Friends are useful for iterators and global operator functions.
- In general, minimize friend declarations, for maintenance reasons.
Avoid cyclic dependencies between components.
Especially avoid cyclic dependencies between packages.
- If two classes are interdependent, either break the dependency or
put them in the same component.