Saturday, April 3, 2010

Exercise 12 - Topic 9

Examine the Use Case in figure 9.2, page 60, and explain the MVC architecture of the online bookstore (the Model, the View and Controllers) needed to Lookup Books and Add to Shopping Cart.

Lookup books:
  1. View: A customer looks up or searches for book from a web page.
  2. Controller: The controller takes in the request, makes a call to the database and loads the data into memory which is the model.
  3. Model: The model is the object in memory that holds the data that is returned in step 2.
  4. Controller: The controller retrieves the data from the model and pass it to the view.
  5. View: The page is displayed that contains data returned in step 4.
Add to shopping cart:
  1. View: A customer add a book to the shopping cart.
  2. Controller: The controller takes the request, creates the model object and the request to the model.
  3. Model: The model is the object in memory that contains the book add to shopping cart in step 1.
  4. Controller: The controller gets the message from step 2 on whether the book has been successfully added or not.
  5. View: The controller passes the message from step 4 to customer that the book is successfully added or could not be added.

No comments:

Post a Comment