O'Reilly logo

JavaScript Object Programming by Martin Rinehart

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 5

image

On OOP Principles

Here we take another break from coding to look at the principles of OOP in theory. JavaScript supports most of them very nicely.

According to the principles of object-oriented programming, all OOP languages have three traits in common: encapsulation, polymorphism, and inheritance.

—Subhasis Nayak

This declaration is typical in discussion of OOP’s main principles or concepts. Encapsulation, polymorphism, and inheritance have been cited as the “big three” as commonly as any. In Wikipedia’s excellent article on OOP, one section is devoted to the foolishness of picking any three characteristics of OOP in this manner (and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required