Working primarily on web applications, I’ve focused most of my time on ASP.NET Web Forms since the very early betas. Web Forms were truly a great revolution in the web world. Once I saw the functionality when it first came out (when I was using ::shudder:: “classic” ASP), I couldn’t wait to start using it. I began right away with ASP+, as it was called back in 2000, abandoning Visual Interdev and ASP, yippee. The release of Version 1.0 came out January 16, 2002, changing the way we work with the web.
Flash-forward 7 years (9 from the early betas), and the programming world has changed. With things like TDD (Test Driven Development), AJAX, JSON, jQuery, etc, and the complexity of web applications growing, sometimes Web Forms would get in the way. To be fair, the Web Form framework is very robust and tries to be helpful, but sometimes we developers like to shoot ourselves in the foot. One example that I’m sure many of you have experienced is trying to interface with a server-rendered element on the page. Performing something like a
ctl00\_mainContent\_LoginCtrl_UserName, does it? On this particular topic, ASP.NET 4.0 has a solution for this problem, but that isn’t the focus of this post. The Client Id problem, is just one example of the framework “getting in your way.” This is one of the many reasons behind the advent of ASP.NET MVC. Having just finished Professional ASP.NET MVC 1.0 from Wrox, I’m a convert.
The Book – Overview
First, the combo of authors on this book, Conery, Hanselman, Haack, and Guthrie, cannot be beat. The book starts out with the now famous NerdDinner ASP.NET MVC Tutorial from ScottGu, but it’s so much more than that. First off, the book is a very interesting read. I’ve read countless programming books, some good, some bad, and some downright ugly. This book stands out as one of the good ones. This could just be the geek in me, but I found myself at times not wanting to put the book down. That’s a good sign for a book on software development. One of the things that I liked best was the “Product Team Aside” sections. Being a developer, I’m interested in the thought process that has gone into building a framework like ASP.NET MVC. I’ve read reviews on Amazon, where readers didn’t like that feature. I don’t get it, but everyone is entitled to their own opinions. Personally, I would read an entire book regarding the design decisions for something like ASP.NET MVC. Before continuing, one more complaint that I’ve seen is that the book is “too beginner.” This may be true if you’ve been using ASP.NET MVC full time for quite a while, but I felt that it had the right feel for someone coming from the Web Forms and starting down the ASP.NET MVC path. The concepts were easy to grasp, and again it was an enjoyable read. Overall I feel that the authors did a great job.
Most of the chapters in the book are ones you would expect from one on ASP.NET MVC, they discuss topics such as:
- URL Routing
- HTML Helpers
A few of the chapters stood out however…
Chapter 3 was very enjoyable and well written. It goes over what’s in every Web Form developer’s mind, “Is ASP.NET MVC better than Web Forms.” It tackled a lot of the concerns that a Web Form developer might have as well as the thoughts running through our minds. I liked that there was an element of humor to the chapter and the book overall, for example on the topic of a Web Forms developer seeing MVC Views for the first time, “1999 called and they want their Classic ASP Spaghetti Code back!”
Chapter 4 gets into the details of the framework with routes and URLs. Right up front, it compares Routing to URL Rewriting, a question that I think lots of ASP.NET developers may have. Note that Routing is available as part of ASP.NET 3.5 SP1 and isn’t specific to MVC, so even if you aren’t jumping over to MVC just yet, you may find URL Routing to be useful in your applications today. The chapter then digs into Routing in detail. There was even an example of using Routing with Web Forms as well, which I thought was a great addition.
Chapter 9 discusses securing the MVC application. I quite enjoyed the tone of the chapter. The examples given were real-world problems and were very interesting. Honestly, security is often a fairly boring topic, but in this book it’s presented in a way that’s very engaging.
Chapter 11 really interested me. It talks about testable design patterns, something that often is ignored in order to “get the job done.” I found the chapter very useful coming from working on teams where testing is somewhat of an afterthought. In an ideal world, we’d all have fully testable, maintainable code, and everything would just be “perfect,” but sadly in the real world, this often doesn’t translate. The concepts presented in this chapter are practical practices that can easily be done in order to position your code for better quality in the long run, even if your team isn’t the testing type.
Finally, Chapter 12 discusses using MVC and ASP.NET Web Forms together. This chapter is extremely helpful if you are porting an existing application over to MVC. I like the fact that the authors added an example of porting over a Web Forms application to MVC.
Coming from the Web Forms world, I would highly recommend Professional ASP.NET MVC 1.0. If you are looking strictly for a reference book that will just sit on the shelf until you need parts of it, then this may not be for you. However, if you are looking for something to get you up to speed on ASP.NET MVC quickly, then I think you too will enjoy it.