Sunday, May 2, 2010

Exercise 12: Modeling with UML or MVC?

Examine the Use Case in Figure 4 and explain the MVC architecture



Make Connection
Model: Logon model receives the logon command or enrollment command and pass to respective controllers.
View: Logon page which allow user to input the username and password or redirect new user to enrollment page.
Controller: The Logon Controller receives the user’s logon credential and verify if it is correct.

Lookup Books
Model: Books Lookup Model which receives the input from customer and pass to the Search Controller.
View: Search page which allows users to input the book name or author keyword. After searching, the result should be displayed in another view as a list with the most relevant and the latest on top.
Controller: The Search controller gets the search criteria and search the database with appropriate result and renders the result back to the result view page.

Shopping Cart
Model: Shopping Cart Model which receives the user’s book selection and pass to the Shopping Cart Controller.
View: Shopping cart page which allows users to checkout or take away the items in the shopping cart.
Controller: The Shopping Cart Controller receives the book selection and performs action either to checkout or get items removed from the cart.
If this is the customer’s first visit, it would pass the user to another controller to collect user’s information including the delivery address and payment details. Otherwise it would go straight to the checkout section.
If checkout command received, the items would be passed on to calculate transaction and verify the fund in user account. It would render the successful or fail transaction to let the user know the final status. Or if remove command executed, the controller would remove the selected items from the cart and render the updated list in the shopping cart.

Check Order Status
Model: The Status model gets user’s request and pass to the Check Order Status Controller.
View: Displays every item purchased and the status on whether it is processing or delivering.
Controller: The Check Order Status Controller would check for the database and renders the status to the view for the list of items purchased with the status details.

No comments:

Post a Comment