New Tutorial – ASP.NET MVC Version 2

I just posted a new tutorial that covers the Microsoft ASP.NET MVC 2 Framework. The Model-View-Controller (MVC) pattern has been around a lone time (I was first introduced to it in the Java world.) MVC clearly delineates the function of presenting a view, managing a model (usually data access and business rules), and managing and coordinating these activities via a controller.

In this tutorial, I take my “golf handicap” application and implement it using the MVC pattern. You will see how to set up controllers for major functionality and how to add action methods within a controller. You’ll also see how views are generated and called from the controllers. You’ll also see how URL mapping is used to access the various controller action methods.

My model is built from an SQL Server database and I use the Entity Framework to provide a mapping between the RDB and the entity model. I also create a number of specialized POCO classes that I use to provide presentation views.

You’ll see how both server and client-side validation is implemented in the MVC Framework.

Microsoft is very clear in stating that their ASP.NET Web Form model (the way things have been in ASP.NET since it’s inception) and the MVC model are viewed as equal partners in the Microsoft set of tools. They assure us that they are just providing alternatives and do not recommend one approach over the other.

 

bill



2 Responses to “New Tutorial – ASP.NET MVC Version 2”

  1.   Goport Says:

    Thanks for this great tutorial.

    IMHO Is not clear why you are using POCO Classes. A further comment will enlight even more, this great post.

  2.   Burrows Says:

    Goport,

    The only POCO class that I could have done as a straight EF class is the POCO_Course class. I added this class so I could put the data annotations on the properties. As an alternative, I could have built a partial (buddy) class based on the Course EF class.

    The other two explicit POCO classes (POCO_PM_CourseTee and POCO_PM_Score) were necessary because they include members from each of the original EF classes (Score and Course). These two classes were created for presentation purposes where the user sees properties taken from each EF class in one display (table).

    Hope this helps … bill

Leave a Reply

*