Wednesday, May 19, 2010

Exercise 12

Examine the Use Case in the above Figure,  and explain the MVC architecture of the online bookstore (the model the view and controllers) needed to Lookup Books and Add to Shopping Cart
MVC or Model View Controller, has been developed to match the input-process-output model in the GUI realm.  This model enable modifications to be made easy by isolating data logic and user interface.
MVC consist of 3 elements.
The Model, act as the data element mapping , which is often some objects that will connect to the database or data source make the query and send the data to the view through the controller.
The View is responsible for the output and will automatically redraw the output when there is a change in the query data.
The Controller is the methods or functions or processes that will take place as the result of the data input through the View element.
Context is the concept by which the 3 elements communicate to each other.
When the client send a request to the server,usually controller which is by which means the input will be done, eg form filling or a simple search text, will take control of the information and will process  the request, in this case, looking for books details.
The controller will then communcate with the model, which encapsulate the business logic. The model will query the database or the data source for the given input.
Finally the control is forwarded to the view through the controller as the model do not cummunucate straight to the view element.

No comments:

Post a Comment