---
title: "Refused Bequest"
type: "code-smell"
slug: "refused-bequest"
url: "http://localhost:3000/en/smells/refused-bequest.md"
category: "Object-Orientation Abusers"
description: "If a subclass uses only some of the methods and properties inherited from its parents, the hierarchy is off-kilter. The unneeded methods may simply go unused or be redefined and give off exceptions."
---
# Refused Bequest

> If a subclass uses only some of the methods and properties inherited from its parents, the hierarchy is off-kilter. The unneeded methods may simply go unused or be redefined and give off exceptions.

## Signs and Symptoms

If a subclass uses only some of the methods and properties inherited from its parents, the hierarchy is off-kilter. The unneeded methods may simply go unused or be redefined and give off exceptions.

## Reasons for the Problem

Someone was motivated to create inheritance between classes only by the desire to reuse the code in a superclass. But the superclass and subclass are completely different.

## Payoff

* Improves code clarity and organization. You will no longer have to wonder why the `Dog` class is inherited from the `Chair` class (even though they both have 4 legs).
## Relations

**Treated by**

- [Replace Inheritance with Delegation](/en/replace-inheritance-with-delegation.md)
- [Extract Superclass](/en/extract-superclass.md)

