3 ms·
Contrary to popular belief, OOP doesn't really encapsulate state, it just hides it. Encapsulated state should mean state that does not contribute to the global
by willtim 9y ago
Contrary to popular belief, OOP doesn't really encapsulate state, it just hides it. Encapsulated state should mean state that does not contribute to the global state space of the system. The danger of OOP is that one ends up with a combinatorial explosion of possible states your system may be in. This may be desired in some situations (e.g. simulations) but does not make a good general approach.
Note that functional languages are also capable of building stateful systems this way, for example Erlang actors or composing finate-state automata.