Skip to Content
Beginning ASP.NET MVC 1.0
book

Beginning ASP.NET MVC 1.0

by Simone Chiaretta, Keyvan Nayyeri
August 2009
Beginner to intermediate content levelBeginner to intermediate
575 pages
13h 16m
English
Wrox
Content preview from Beginning ASP.NET MVC 1.0

Appendix B. Exercise Solutions

Exercise 1 Solution

An application implemented following the MVC pattern is divided into three components:

  • Model — This component's responsibility is to retrieve an object from the database and to apply domain-specific logic.

  • Controller — This is the component that receives the user input, calls the model, and sends data to be displayed by the view.

  • View — The view simply renders the data that it received from the controller.

Exercise 2 Solution

The Presentation Model is the part of the model that contains the objects that are used only with the purpose of sending data from the controller to the view. This contains the data ready to be rendered by the view without further transformations needed.

Exercise 3 Solution

The main differences between MVC and the MVP are:

  • With the MVP pattern the requests first hit the view and then flow to the Presenter, whereas with the MVC, the first component being hit is the controller and the view is the last one.

  • Using the MVC pattern, the various components are standard classes, and they are wired-up together by simple method calls. With the MVP pattern, each view must implement its own interface and must publish some events to which the Presenter must subscribe.

Exercise 1 Solution

Migrating an ASP.NET WebForms application to an ASP.NET MVC application is a broad topic that is covered in Chapter 17. However, it's very helpful for you to think about migration at this point to prepare yourself to understand the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning ASP.NET MVC 4

Beginning ASP.NET MVC 4

José Rolando Guay Paz
Programming ASP.NET MVC 4

Programming ASP.NET MVC 4

Jess Chadwick, Todd Snyder, Hrusikesh Panda
Professional ASP.NET MVC 2

Professional ASP.NET MVC 2

Jon Galloway, Phil Haack, Scott Hanselman, Scott Guthrie, Rob Conery

Publisher Resources

ISBN: 9780470433997Purchase book