Object-Oriented Design
Classes, encapsulation, inheritance, polymorphism, and the design principles and patterns that keep code easy to change.
Topics in this field: 8
- Classes and Objects — A class is a blueprint that bundles data with the operations on it; an object is one instance with its own state.
- Encapsulation — Hide an object's state behind a small interface so it can protect its own invariants.
- Abstraction and Interfaces — Depend on what something does, not how it does it. Interfaces name the behavior and hide the implementation.
- Inheritance — A subclass reuses and extends a superclass. It models 'is-a' relationships — and creates the tightest coupling in OOP.
- Polymorphism — One call, many behaviors: the actual method that runs depends on the object's type at run time.
- Composition vs Inheritance — Build behavior by combining objects (has-a) rather than extending classes (is-a). It is looser, more flexible, and easier to change.
- SOLID Principles — Five heuristics for object-oriented design that keep code easy to change: single responsibility, open/closed, Liskov, interface segregation, dependency inversion.
- Design Patterns — Named, reusable solutions to recurring design problems: creational, structural, and behavioral.