Hacker News new | ask | show | jobs
by bitwize 3005 days ago
I've learned to think of objects as not exactly monadic, but monad-like in their pattern of use: whenever there's a bit of state that I need to track and isolate from all other state in the system, wrap that in a class. The allowable state transitions then become methods.
1 comments

Right, and most of the times, if state have different life times, then it should be in different classes.
What do you mean by life times?
Is the state eternal or not (ie is it immutable)? Will the state typically change at the same time as some other state (like an address, or stuff related to some other event)?