Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Book Review: Practical ASP.NET MVC 4.0

0.00/5 (No votes)
23 Dec 2012 1  
This books is a tour de force and a must-have for any ASP.NET MVC developer as it will save you hours of time and frustration researching solutions to the various questions you may encounter when using MVC 4.

This article is in the Book Review chapter. Reviews are intended to provide you with information on books - both paid and free - that others consider useful and of value to developers. Read a good programming book? Write a review!

Introduction

I am not really into .NET 'cookbooks' and I prefer books with an academic discussion of .NET. Cookbooks are typically best suited for folks who are already somewhat versed in the subject and want to find solutions to a very particular problem or to check the validity of one's own solution. This book does offer that kind of help, but it's so well done, that it also offers a very good and accessible solution to the ones starting out with an ASP.NET MVC project. 

Currently the authors offer 22 out of 25 recipes, since the book is being made available as an early access edition. But in the 22 chapters made available, it does cover a lot of tricky ground, from elementary to advanced, all in the same clear, essential, no fuss, hands on style. There's a lot to ASP.NET MVC and I think you need to read more than a few books before you really 'get' it, but if you are developing professional MVC apps, this book pays for itself by the time you hit page 15. The book and the rest of the chapters and other resources will be available in the last week of Jan. 

Book Contents 

The book using a recipe approach covers some core areas of ASP.NET MVC, and does a phenomenal job of explaining some important features - and more importantly how to take advantage of them. In addition to covering some of the built-in features of ASP.NET MVC 4.0, the books covers how to implement common scenarios with it like implementing CAPTCHAs, Authentication and Authorization using Web API, how to use helpers, some advanced usage of models and controllers, Bundling techniques, using Visual Studio features to manage resources, and much more.

 

The first 5 chapters focus on Security with a focus on Authentication and Authorization. Be it a way to restrict access to some resources, or implement Role Based Authorization in ASP.NET MVC 4 Web API and against Active Directory or using CAPTCHA to prevent forms from spam submissions, the book reveals it all.

The next few chapters discusses practical usages of the parts that constitute the MVC pattern, namely the Model, the View and the Controller, with Web API thrown into the mix. These chapters also provides a solid overview of the error handling capabilities of the MVC framework including some nice examples. Chapter 6 contains information on how to create view model and share it among controllers. These chapters also discuss controller factories, action filters, model bindings etc. … . Chapter 11 and 12 discusses how to leverage templates and creating partial views which I find are quite important features for composing scalable web applications.

Chapters from 13 onwards to 22 are a mix of some very practical tips with Example after Example after Example of just cool stuff, with great implementations, best practices, introductions to frameworks like the Unity and Cassette and clearly written recipes. Chapters like sharing scripts in multiple projects are extremely useful for small teams.

For those interested in the new features in ASP.NET MVC 4, you are introduced to features like Display Modes, New Authorization techniques, Error handling enhancements and Web API.

Recommended Audience 

As far as the recommended audience, I think you need a little ASP.NET MVC experience to really appreciate this book (although if you are just begining with MVC, it's still a good resource when you hit a project). The authors themselves recommend this book is written for architects and web developers wanting to understand how to perform common tasks using the latest version of the ASP.NET MVC platform. 

Final Word 

I have read many good .NET books, and it'd be impossible to pick the one that is the 'best'. However, if you want some great practical MVC examples, you'll fall in love with this book quickly. Its a tour de force and a must-have for any ASP.NET MVC developer as it will save you hours of time and frustration researching solutions to the various questions you may encounter when using MVC 4. Do not start your project without it!

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here