Code Smells

Code Smells / Object-Orientation Abusers / Alternative Classes with Different Interfaces

Alternative Classes with Different Interfaces code smell icon

Alternative Classes with Different Interfaces

When closely related classes lack a common interface, this is an Alternative Classes with Different Interfaces smell.

Reducing this will increase the legibility and understandability of the code. To do this, you could rename public methods and modify code parameters to be the same, create a superclass above both classes, and remove any Dead Code smells.

Books about code smells

Learn to write better smelling code.

Refactoring: Improving the Design of Existing Code book cover

Refactoring: Improving the Design of Existing Code

Code smells: A Predictor of Remarkable Quality Improvement book cover

Code smells: A Predictor of Remarkable Quality Improvement

Clean Code: A Handbook of Agile Software Craftsmanship book cover

Clean Code: A Handbook of Agile Software Craftsmanship

I receive a commission on sales made from the above affiliate links.