Class Inheritance Causes Many Problems - Deepstash
Machine Learning With Google

Learn more about computerscience with this collection

Understanding machine learning models

Improving data analysis and decision-making

How Google uses logic in machine learning

Machine Learning With Google

Discover 95 similar ideas in

It takes just

14 mins to read

Class Inheritance Causes Many Problems

  • The tight coupling problem (class inheritance is the tightest coupling available in oo design), which leads to the next one…
  • The fragile base class problem
  • Inflexible hierarchy problem (eventually, all evolving hierarchies are wrong for new uses)
  • The duplication by necessity problem (due to inflexible hierarchies, new use cases are often shoe-horned in by duplicating, rather than adapting existing code)
  • The Gorilla/banana problem (What you wanted was a banana, but what you got was a gorilla holding the banana, and the entire jungle).

2

8 reads

MORE IDEAS ON THIS

What’s the Difference Between Class & Prototypal Inheritance?

  • Class Inheritance: A class is like a blueprint — a description of the object to be created. Classes inherit from classes and create subclass relationships: hierarchical class taxonomies.
  • Prototypal Inheritance: A prototype is a working object instance. Objects inherit directly from o...

3

34 reads

There Are Three Kinds of Prototypal OO

  • Concatenative inheritance: The process of inheriting features directly from one object to another by copying the source objects properties. 
  • Prototype delegation: If a property is not found on the object, the lookup is delegated...

2

8 reads

Related collections

Other curated ideas on this topic:

What does “favor object composition over class inheritance” mean?

Good to hear:  

  • Avoid class hierarchies. 
  • Avoid brittle base class problem. 
  • Avoid tight coupling. 
  • Avoid rigid taxonomy. 
  • Avoid the gorilla banana problem. 
  • Make code more flexible. 

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Personalized microlearning

100+ Learning Journeys

Access to 200,000+ ideas

Access to the mobile app

Unlimited idea saving

Unlimited history

Unlimited listening to ideas

Downloading & offline access

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates