Classical Inheritance is Obsolete: How to Think in Prototypal OO

A session at O'Reilly Fluent Conference 2013

Wednesday 29th May, 2013

5:05pm to 5:45pm (PST)

In “Design Patterns”, the Gang of Four recommend two important principles of object oriented design:

  • Program to an interface, not an implementation.
  • Favor object composition over class inheritance.

Why is the seminal work on Object Oriented design so distinctly anti-inheritance? Because inheritance causes several problems:

  • Tight coupling. Inheritance is the tightest coupling available in OO design. Descendant classes have an intimate knowledge of their ancestor classes.
  • Inflexible hierarchies. Single parent hierarchies are rarely capable of describing all possible use cases. Eventually, all hierarchies are “wrong” for new uses—a problem that necessitates code duplication.
  • Complicated multiple inheritance. It’s often desirable to inherit from more than one parent. That process is inordinately complex and its implementation is inconsistent with the process for single inheritance, which makes it harder to read and understand.
  • Brittle architecture. Because of tight coupling, it’s often difficult to refactor a class with the “wrong” design, because much existing functionality depends on the existing design.
  • The Gorilla / Banana problem. Often there are parts of the parent that you don’t want to inherit. Subclassing allows you to override properties from the parent, but it doesn’t allow you to select which properties you want to inherit.

In this talk, you’ll see lots of examples demonstrating both the weaknesses of the classical OO style in JavaScript, as well as the strength and flexibility in prototypal alternatives, including:

Delegation / Differential Inheritance
Cloning / Concatenative Inheritance / Mixins
Closure Prototypes / Functional Inheritance
Factory Functions
Complex Object Composition

About the speaker

This person is speaking at this event.
Eric Elliott

Author, "Programming JavaScript Applications"

Coverage of this session

Sign in to add slides, notes or videos to this session

Tell your friends!


Time 5:05pm5:45pm PST

Date Wed 29th May 2013

Session Hash Tag


Short URL


View the schedule


Books by speaker

  • Programming JavaScript Applications: Robust Web Architecture with Node, HTML5, and Modern JS Libraries

See something wrong?

Report an issue with this session