Reputation: 3263
Need explanation of the below state table. I really cannot wrap my brain around it.
Problem: Draw a state diagram that models a user's shopping session at amazon.com, starting with a search. Show the UML for an implementation using the state design pattern including key fields and headers for the methods in the states.
SOLUTION As an example, here are three states: matches, product detail and shopping cart. When a user searches for a product, all matches are shown. When the user clicks on a match, the product detail is shown, and when the user adds a product to the shopping cart, the shopping cart is shown. The following shows a state transition table (a search can be done on any of these pages). For any cell (state i, state j), the action in that cell leads to a transition from state i to state j.
...
Upvotes: 1
Views: 244
Reputation: 1082
To read the state table you look at the left column. There you look for the state you are in. In the corresponding row you scan to teh right and look for the event that occured. Then yo move to the top of its column and see to whicht state it would lead.
Upvotes: 1
Reputation: 11
does this help? http://www.dofactory.com/net/state-design-pattern https://sourcemaking.com/design_patterns/state these type of website always helps me !
Upvotes: 0