UP | HOME
../../

Design Smells

"Design smells … indicate violation of fundamental design principles and negatively impact design quality"

1 Common design smells

  1. Missing abstraction when clumps of data or encoded strings are used instead of creating an abstraction. Also known as "primitive obsession" and "data clumps".
  2. Multifaceted abstraction when an abstraction has multiple responsibilities assigned to it. Also known as "conceptualization abuse".
  3. Duplicate abstraction when two or more abstractions have identical names or implementation or both. Also known as "alternative classes with different interfaces" and "duplicate design artifacts".
  4. Deficient encapsulation when the declared accessibility of one or more members of an abstraction is more permissive than actually required. Also known as "hideable public attributes/methods".
  5. Unexploited encapsulation when client code uses explicit type checks (using chained if-else or switch statements that check for the type of the object) instead of exploiting the variation in types already encapsulated within a hierarchy. Also known as "simulated polymorphism".
  6. Broken modularization when data and/or methods that ideally should have been localized into a single abstraction are separated and spread across multiple abstractions. Also known as "data class" and "data records".
  7. Insufficient modularization when an abstraction exists that has not been completely decomposed, and a further decomposition could reduce its size, implementation complexity, or both. Also known as "God class", "fat interface", and "blob class".
  8. Cyclically-dependent modularization when two or more abstractions depend on each other directly or indirectly (creating a tight coupling between the abstractions). Also known as "dependency cycles" and "cyclic dependencies".
  9. Unfactored hierarchy when there is unnecessary duplication among types in a hierarchy. Also known as "significant sibling duplication" and "orphan sibling method/attribute".
  10. Broken hierarchy when a supertype and its subtype conceptually do not share an “IS-A” relationship resulting in broken substitutability. Also known as "inappropriate use of inheritance" and "misapplying IS A".
  11. Cyclic hierarchy when a supertype in a hierarchy depends on any of its subtypes. Also known as "knows of derived" and "inheritance/reference cycles".

2 References

  1. https://en.wikipedia.org/wiki/Design_smell [The above is based wholly on the wiki article.]

Copyright © 2015 • www.wright.edu/~pmateti