I have a Contract class. The contract is valid 1 Jan 2010 - 31 Dec 2010.
It can be in state Active or Passive, depending on which date I ask the instance for it's state. ex. if I ask 4 July 2010, it's in state Active, but if I ask 1 Jan 2011, it's in state Passive.
Statemachine diagram:
From Start state, which state should it go to next ? I'm thinking a pseudo state "default" with an entry function deciding which state to go to next, and then a substate machine with Active and Passive, and then an End state on removal.
But this seems to complicated for such a trivial problem.
How would you do it ?