#OOP vs Data Oriented Programming Which One to Choose
summary
Argues that choose OOP when you need runtime polymorphism and extensibility but prefer data-oriented code when third‑party types force parallel hierarchies. Shows a concrete Java example: a trade model (Sell/Buy records) + interceptor implementations that became messy with reflection and factory logic; replaces them with sealed interfaces, records and a pattern‑matching switch to get compile‑time errors when a new Trade appears. Result: simpler, clearer code, fewer classes, tradeoff is less plug‑in extensibility but easier maintenance and earlier errors.
AI-written summary · about
chapters (7)
- 0:00Introduction to OOP vs DOP
- 1:49OOP pillars and polymorphism
- 13:27When OOP becomes problematic
- 23:25Code smell and parallel hierarchies
- 33:46Tradeoffs in design principles
- 44:48Simplifying with sealed interfaces
- 55:46Choosing OOP vs DOP wisely








