OOP vs. DOP: Which One to Choose?
summary
Argues that for a concrete order/trade example the Java features replace clumsy visitor/factory plumbing: a processTrade that audits buys when quantity > 5,000 and sells when quantity > 10,000 moves from interface+auditor classes to a concise switch with pattern matching in switch, using sealed interfaces and records and destructuring. The prototype runs, gives faster compile‑time feedback on new types, reduces accidental complexity, but intentionally violates Open/Closed as a documented tradeoff.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 0:42OOP pillars explained
- 5:00Polymorphism in payments
- 16:16Challenges with patterns
- 25:17Simplifying code with pattern matching
- 37:35Sealed classes for safety
- 44:30Destructuring records in Java
- 51:37OOP versus DOP tradeoffs
- 57:20Choosing the right tool
- 59:48Conclusion
related talks
01h 00mOOP vs Data Oriented Programming: Which One to Choose?
58m#OOP vs Data Oriented Programming Which One to Choose
49mData-oriented Programming in Java
44mDesign Patterns in the Light of Lambda Expressions
31mData Oriented Programming and Matching in Java
01h 01mOOP and FP
44mJava Evolution Vector: DOP
53mData oriented Programming in Java
