I have an entity, equivalent to a task, that can have multiple states. The "task" can either be in a pending, passed, or failed state. Each one of these states will also have some unique data. For instance, in a failed state the entity should have a reason for the failure, in the pending state it should have a deadline for evaluation, ect.
While the above leads me to think I should have a separate object to represent each state, the underlying ID for the entity should remain the same, pushing me back towards thinking of this as a single object.
Also, transitioning from state to state requires some logic. A "pending" task transitioning to a "passed" state will be treated differently than a "failed" task making the same transition.
If the representations for each state were exactly the same I'd just use a primitive property and be done with it. However, since the different states have slightly different representations, I've been struggling to figure out the best way to model this. The logic for governing the internal state is getting a little messy so I figured I'd step back and reconsider. Any thoughts?
I'm using c# though I'd consider this language agnostic.