Drawing the Lines
Managing reusability to gain the greatest benefit and avoid pitfalls depends on five factors:
- Overall Design. Unless you start with the big picture, designing the pieces will be an ad hoc process and, therefore, endless. Begin with a well-thought-out architecture so you know which components can and should be reused, where they fit, and their precise function.
- Balance Granularity. Resist the urge to make too many components. The greater the number of components, the harder it becomes to manage and maintain them. Some duplication of lines of code may be preferable to managing yet another component. Less may be best.
- Enforce Standards. You can't use a component if you don't know it exists, where to find it, or what it does. This means that naming, documentation, and design conventions are a must. Mystery components will clutter your library and cause duplication and confusion.
- Centralize Control. As with any software, changes to components must be tightly managed, including version and change control. Don't let just anyone modify a component to suit her needs, as this may cause unforeseen problems.
- Provide Training. Make sure everyone on the team is trained on the component library, including where it can be found, the names of the components, the functions of each component, and the conventions and procedures for managing them.
Done right, reusability and usability enable each other. Approached casually, they work against each other. So don't just assume reusability is right: Make sure it is.