THE ATHENA LIBRARY
Object-Oriented Programming Foundations
Selam Tesfaye & R. Lindqvist textbook
Chapter 2 · The Four Pillars
Abstraction, encapsulation, inheritance, polymorphism
Abstraction decides what a class should reveal. Encapsulation enforces that decision by hiding internal state. Inheritance lets new classes reuse and specialise existing ones. Polymorphism lets code treat many specialised objects through one general interface.
The pillars reinforce one another. Encapsulation makes it safe to change implementations; inheritance and interfaces create families of related types; polymorphism lets the rest of the program ignore which member of the family it is using.
Throughout this book, each pillar is shown in both Java and Python so that the idea, rather than the syntax, remains in focus.
The pillars are not four separate rules, but one way of thinking seen from four angles.
Fictional educational sample written for the Athena demo · Page 41 of 298.
50%saved