Effective C++ Ed. 3rd: Item 31. Minimize compilation dependencies between files

It is beneficial if the implementation changes in a library does not forces the clients to re-compile their code. But how would you minimize compilation dependencies? The key to this is replacement of dependencies on definitions with dependencies on declarations. There are following 2 ways:
  • Handle classes: By employing pimple idiom in classes.
  • Interface classes: By declaring abstract base class
Besides this, libraries should be implemented as declarations and definitions in separate header files. So that clients only include header files containing declarations only.

prev | next
Cheers and try hosting at Linode.

No comments:

Post a Comment