Tuesday, May 25, 2010

Exercise 12: Modelling with UML or MVC?

Examine the Use Case in Figure 4 and explain the MVC architecture of the online bookstore (the model the view and controllers) needed to Lookup Books and Add to Shopping Cart.




Model-View-Controller (MVC), an architechural pattern that is used for seperating our application into multiple parts, is probably one of the most mentioned patterns in the web application development in recent years (Pastor, 2010).

In MVC,an application is devided into three different parts based on the responsibilities of each part. The model will handle data and business logic, the controller is responsible for handling user's requests and call appropriate resouces(objects) to fullfil these requests and then forward the results to the view.The View acts as a user interface in which users can enter requests and receive results from the controller. The view can present data to users in any supported formats or layouts (Pastor, 2010). The main advantage of the MVC approach is the seperation between application logic and user's interface (presentation).

In the Usecase diagram above, the use case 100(make connection) is the controller. This controller will handle any user's requests, then call appropriate functions(also called as usercase) in the model such as lookup books(104) and Add to Shopping Cart(105). After processing the database the model will return founded data to the controller, then the controller will select appropriate view to present the results to user.

Note: the View and the Model are not shown in this UseCase Diagram.

Reference

Pastor, P.(2010).MVC for Noobs. Viewed 14 May 2010 from http://net.tutsplus.com/tutorials/other/mvc-for-noobs/

No comments:

Post a Comment