4 ms·
I don't think you actually do state management in OOP, only manage a single level of abstractions. In java, inheiretance is directional in a single way, but if
by gchamonlive 7y ago
I don't think you actually do state management in OOP, only manage a single level of abstractions.
In java, inheiretance is directional in a single way, but if you instantiate a singleton component, you can end up affecting the state of every other class that uses that same component. This is not wrong per se, it is a property of OOP in itself.
If this rubs you the wrong way, possibly you should be working in purely, monadic functions.
- BiteCode_dev 7y agoIn think singleton has been labelled as anti-pattern in OO for a long time. Having a single reference is useful, but using instantiation as a way to get it has proven a bad design decision.
- gchamonlive 7y agoThat is really my point. Isn't it better to just use a tool that limits what bad decisions you can make? Or at least make these bad decisions so hard that once you know how to implement them, you know better ways to write your code?