Requests stack
Status: Alpha
Brought to you by:
azplamen
Handled request should be stored in stack. This will help in navigation throught pages. Size of stack should be configured (MAX_HISTORY).
Every request should have additional methods and fields to support stack:
String goBack() if previous request (parent request) is available return its outcome, else forward to home.
Request previousRequest - previous request (parent request) if available or null
String outcome - outcome to navigate to this request (used by goBack())
void setPreviousRequest(Request) - setter for previousRequest, in addition removes from stack items that are more than MAX_HISTORY
Method:
String getLabel() should be added to interface. It will return user friendly representation of navigation item and will be used in navigation line.
Other case is to save stack centralized, not distributed - one object that manages sequence of requests (each request does not know about others, no setPreviousRequest()).
Should be discussed which one possibility to chose.