state transition with different guard condition
In the state pattern how is this modeled ? state A to state B on trigger X and conditon C1 when current state is A state A to state C on trigger X and condition C2 when current state is A how is this usually accomplished ? I have a lot of guard conditions that I may need to implement. That's pretty standard see e.g. this example . [Edited on basis it's not homework!] Assuming I understand right: You have one event ( X ) which can trigger one of two possible transitions Selecting which transition to fire is made according to which condition holds true ( C1 or C2 ) If so that's a standard case