All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.plugins.csharp.S110.html Maven / Gradle / Ivy

There is a newer version: 10.2.0.105762
Show newest version

Why is this an issue?

Inheritance is one of the most valuable concepts in object-oriented programming. It’s a way to categorize and reuse code by creating collections of attributes and behaviors called classes, which can be based on previously created classes.

But abusing this concept by creating a deep inheritance tree can lead to complex and unmaintainable source code. Often, an inheritance tree becoming too deep is the symptom of systematic use of "inheritance" when other approaches like "composition" would be better suited.

This rule raises an issue when the inheritance tree, starting from Object, has a greater depth than is allowed.

Resources

Documentation

Composition over inheritance: difference between composition and inheritance in object-oriented programming





© 2015 - 2024 Weber Informatics LLC | Privacy Policy