public static void Run() { UserStory userStory = new UserStory(); userStory.RemoveFromBacklog(); userStory.MoveToBacklog(); userStory.StartImplementation(); userStory.AcceptanceTestsFail(); userStory.StartImplementation(); userStory.AcceptanceTestsPassed(); userStory.StartImplementation(); //This is the first example where a state may not execute all transitions //There is an active debate if this violates liskov substitution principle or not -> https://en.wikipedia.org/wiki/Liskov_substitution_principle //but leaving that asside, assuming we will have to add another transition availalable that can be executed only from one state //we will have to modify all the existing states, just to throw the exception. //To view what are the allowed transitions, is very hard when using state pattern with roles }
public ScrumStateRemoved(UserStory userStory) { this.userStory = userStory; }
public ScrumStateActive(UserStory userStory) { this.userStory = userStory; }
public ScrumStateClosed(UserStory userStory) { this.userStory = userStory; }
public ScrumStateNew(UserStory userStory) { this.userStory = userStory; }