Chapter 6

Hierarchy Smells

Abstract

A hierarchical organization of entities offers a powerful means to deal with complex relationships among real-world entities; it helps one to order the entities, deal with similarities and differences, and think in terms of generalizations and specializations. This chapter discusses the principle of hierarchy and key enabling techniques (i.e., apply meaningful classification, apply meaningful generalization, ensure substitutability, avoid redundant paths, and ensure proper ordering) that allow us to apply the principle of hierarchy in software design. This is followed by a detailed description of the following design smells that result from the violation of the principle of hierarchy: Missing Hierarchy, Unnecessary ...

Get Refactoring for Software Design Smells now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.