OOP Cheat Sheet
Pillars
Encapsulation: hide data
Abstraction: hide complexity
Inheritance: IS-A, reuse
Polymorphism: overload (compile time), override (runtime)
Comparisons
Abstract class: state, 1 parent, IS-A
Interface: contract, many, CAN-DO
Aggregation: part lives alone · Composition: part dies with the whole
Patterns
Singleton: one instance · Factory: hide creation · Builder: step by step
Strategy: swap algorithm · Observer: notify subscribers
Adapter: fit an interface · Decorator: wrap to add behaviour · Facade: simple front
SOLID
S one job · O extend, don't edit · L subclasses substitute
I small interfaces · D depend on abstractions
Full OOP documentation