by jhgb · 5y ago · 0 comments
No, not really. For example:
> - make it hard/impossible to set the true state of the system in its entirety
Strangely enough, environments like Smalltalk allow you to do exactly that, but other environments not so much.
For better or worse, Java is massively popular, and thus the Java conceptualization of OOP, which is just frankly bad, is what most people think of when they think OOP.
OOP encapsulation works when you can't have objects with invariants violated, and when you can't cover the combinatorial space with tests. The problem is, Java-style setters and getters are an almost guaranteed way to get the above properties. That's why it's better to be able to just have a small number of course-grained state stores that you can interrogate easily (REST, Reactors, databases, and Kubernetes data models all exhibit this). Class Employee inherits Person, doesn't. Too fine-grained, too easy to mutate yourself into an absolute mess.
In which camp does CLOS (the Common Lisp Object System) fall?