OOP revisited
summary
Practical checklist for making Java code actually object oriented: avoid JavaBean setters/getters and Lombok-generated mutability, prefer domain methods and immutable returns, validate in constructors, use Optional for nullable state or wrap it internally, measure cohesion with LCOM4 metric, apply tell don't ask, prefer composition over inheritance, use ports/adapters / hexagonal architecture for dependency inversion, beware of sealed classes and toList immutability leaking mutability, and keep public API minimal and focused.
AI-written summary · about
chapters (25)
- 0:00Intro
- 0:32What is OOP
- 2:13Principles
- 3:13Encapsulation
- 10:29Visibility
- 11:43Abstraction
- 12:52Information experts
- 15:26Law of the matter
- 16:34Single responsibility principle
- 20:41Inversion
- 24:39Creator
- 26:26Interface segregation
- 28:16Inheritance
- 29:13Risk of Substitution
- 30:26OpenClose Principle
- 31:36Explicit Branch
- 32:19Seed Classes
- 33:29Object Class
- 34:43Prevent Inheritance
- 37:07Composition
- 38:49Polymorphism
- 39:37Overriding
- 40:36Evolution
- 42:42Rename
- 42:56Key takeaways
related talks
48mOOP revisited
45mBeyond design patterns and principles - writing good OO code
51mFunctional Principles for Object Oriented Development
25mOOPs!... I Did it Again: When Good Objects Go Toxic
23mEffective Java
27mObject Oriented Programming Best Practices
01h 05mFrom object oriented to functional domain modeling
35mThe League of Extraordinary Antipattern
