Unexploited Encapsulation

This smell arises when client class 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.

Related smells: Switch Statement Type Queries

Tools

The following set of tools detects this smell: Designite(for C#) DesigniteJava(for Java)

Reference

G. Suryanarayana, G. Samarthyam, T. Sharma, “Refactoring for Software Design Smells: Managing Technical Debt”. Morgan Kaufmann, 2014.


Design Smells

Home

All rights reserved (c) Tushar Sharma 2017-23.