by foobar_ · 6y ago · 0 comments
1. You avoid extends at all costs (avoid inheritance)
2. All classes are declared final, implement one or more interfaces ( you get polymorphism and abstraction)
3. Split data and code and use immutable data or declare all data as private with no public getters and setters (more encapsulation)
4. Ignore anything ever said by OO thinkers and architects because they will eventually ask you to do the above three with a domain specific language in 30,000 words
I'd also throw in "Don't use static functions" and "Write declarative code".
Honestly, I think getting rid of public getters and setters goes a LONG way toward more reasonable objects.