Monday, January 3, 2011

Book Review: Pro ASP.NET MVC 2 Framework

I just finished reading Pro ASP.NET MVC 2 Framework by Steven Sanderson (Apress).  What I found was a good introduction to ASP.NET MVC as well as a deeper dive into the majority of the features.

This is labeled as "Intermediate to Advanced".  It assumes that you are familiar with C# and .NET, but it doesn't expect you to be an ASP.NET WebForms programmer.  If you are familiar with web technologies (HTML, CSS, Javascript), then you should be just fine.  And although this is covering the 2nd version of the ASP.NET MVC framework, it does not assume that you have any prior knowledge of version 1.

There are several things I liked about this book.  First, it is very approachable.  The tone is inviting and easy to understand.  Next, the code samples are thorough.  Since ASP.NET MVC 2 can be used with either .NET 3.5 or .NET 4.0, it shows how to use the framework in either environment, and the differences are pointed out where the environments vary.  Finally, the overall organization makes you want to read more.

Part 1 includes an introduction to ASP.NET MVC 2 and a sample application showing a real-world (although simplified) implementation of the framework.  Since the MVC pattern lends itself to unit testing and test-driven development (TDD), the book also shows a few useful techniques including using dependency injection and mocking with unit testing.  And to keep things more accessible, Sanderson uses free tools (such as NTest) for the examples since not all versions of Visual Studio include unit testing.

Part 2 takes all of the features that were introduced in Part 1 and goes into them in detail.  This includes all of the core features of ASP.NET MVC including Routing, Controllers, Actions, Views, and Models.  But going beyond just a description of using what's "in the box", the book also talks about how you can extend the framework yourself, such as by creating custom controller classes, filters, or even your own view engine.  In addition, it gives a number of helpful techniques for putting together user interfaces including a trip into the world of AJAX and jQuery.

Part 3 covers some of the nitty-gritty details including Security and Deployment.  This is where the world of ASP.NET MVC and WebForms starts to overlap.  And this last part also goes through many of the features of the standard ASP.NET platform that you will want to make use of in your MVC applications.

Unlike my previous review of an ASP.NET MVC book, I highly recommend this book.  The quality of the book is very high.  There are few errors (no book is perfect) and the code samples are well done and complete.  I have become a big fan of ASP.NET MVC.  Although it is not the "best" or "only" way to write web applications, it is a great tool to have in the toolbox.  I can think of a number of applications from my past that would have been much more elegant using ASP.NET MVC.

If you are curious and want to get started in the technology, Pro ASP.NET MVC2 Framework is a great way to go.  Part 1 will give you a taste of the feature; Part 2 will take you through each one in depth; and Part 3 will show how MVC integrates with the rest of the ASP.NET framework.

Happy Coding!

No comments:

Post a Comment