Chapter 12. Library Classes

A modern application will use library classes.

Library classes sometimes put us in a dilemma. We want the library to be different, but we don't want to change it. Even when it's possible to change a library, it carries risks: It affects other clients, and it means we have to redo our changes for future versions of the library.

Smells Covered

  • Incomplete Library Class

Incomplete Library Class


  • You're using a library class, and there's a feature you wish were on that class, but it's not. If it were a normal class, you'd modify it; but, since it is part of a library, you may be unable or unwilling to change it.


The author of the library class didn't anticipate your need (or declined to support it due to other trade-offs). ...

Get Refactoring Workbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.