Pro ASP.NET MVC 2 Framework, Second Edition Paperback – Jun 30 2010
Customers Who Bought This Item Also Bought
No Kindle device required. Download one of the Free Kindle apps to start reading Kindle books on your smartphone, tablet, and computer.
To get the free app, enter your e-mail address or mobile phone number.
About the Author
After a childhood spent at the computer, Steven Sanderson started web development in 1996, first using Perl and later adopting PHP.
His last five years of professional experience have focused on ASP.NET, learning what works and what works better, and experiencing a developer’s life everywhere from an investment bank to a five–person Internet startup.
Steven has led Red Gate's web development team, and spends his free time blogging and keeping up to speed with the latest technology developments.
He’s followed the ASP.NET MVC framework since its inception and frequently participates in online discussions with its core developers at Microsoft.
Inside This Book(Learn More)
Most Helpful Customer Reviews on Amazon.com (beta)
This is an outstanding book for the professional developer who is looking to become an expert on ASP.NET MVC, and who wants to seriously "raise their game" when it comes to software development in general. Steve Sanderson (the author) has a fantastic writing style that is easy to read, and which flows very naturally.
The first 212 pages of the book are mostly spent building two applications (a party invite application and a sports e-commerce store) literally starting with File->New Project and walking you step-by-step through their creation (explaining all of the code keystrokes, C# language features, and Visual Studio steps required along the way). These provide a great set of tutorials that can help you understand how ASP.NET MVC works and can be applied to build common web scenarios.
Sanderson's book avoids simply showing "the basic path" when it comes to building ASP.NET MVC applications, and instead takes the much bolder approach of teaching ASP.NET MVC in conjunction with Unit Testing, Test Driven Development (TDD), Dependency Injection, and Mocking. What makes the book so great is that he is able to make these concepts (which most books consider "advanced topics") straight forward to comprehend and grasp. He introduces them early, explains the concepts behind them quickly, and then does a masterful job of immediately showing how you can apply and use them pragmatically within ASP.NET MVC applications. The result is that they feel natural, you really "get" the concepts behind them, and you are left knowing the exact mechanics and steps necessary to take advantage of them within your own ASP.NET MVC applications. He uses the free, open-source NUnit, Moq, and Ninject frameworks within the book - which work with all version of Visual Studio (including the free express editions).
The remaining 500 pages of the book then go into detail on all the core areas of ASP.NET MVC, and do a phenomenal job of explaining both all of the features - and more importantly how to take advantage of them. In addition to covering the built-in features of ASP.NET MVC, he covers how to implement common scenarios with it like implementing CAPTCHAs, how to take advantage of jQuery, use VS 2010's new web deployment features, and more.
This book is a tour de force and absolutely stunning. It is a must-have for the bookshelf of any professional ASP.NET MVC developer.
Corporate Vice President - Developer Division
The book starts off giving you an overview of what MVC is, how it's different than Webforms and why it's better. It also does a brief comparison to other similar products like Ruby on Rails and MonoRail. The next five chapters are dedicated to building a simple RSVP form and an eCommerce store using MVC 2. It doesn't just give you a simple demo of MVC features but builds an actual working application that could be the beginnings of a real application. Building these applications gives you a great feeling for the language. But Mr. Sanderson isn't content with just teaching you MVC, he also wants to teach you many of the best practices in software development. He covers test-driven (TDD) and behavior-driven development(BDD). I love the ShouldEqual() extension method for simplifying an assert. He covers Nunit, Moq and Specflow (Gherkin BDD language interpreter). He talks about unit testing versus integration testing. He uses Linq to SQL for database integration and Ninject for Dependency Injection. While you can download all of the source code for the applications from the apress.com web site, I typed in all of the samples from the book. I can honestly say I haven't found one sample that didn't work as expected. The book also uses CSS to keep the HTML clean.
Even though I have a good understanding of many of the best practices introduced in the book, I found the book's coverage of these topics the appropriate length and depth. Mr. Sanderson goes to great lengths to support Visual Studio 2008 and 2010 as well as ASP.NET 3.5 and 4.0. At the beginning I was worried the author was going to duplicate examples in both versions but to his credit he quickly transitioned to using ASP.NET 4.0 syntax but with appropriate callouts to bring attention to the differences and warning that there would be no further warnings.
One small criticism of the book was with the use of Linq to SQL. I would have preferred him covering the Entity Framework or nHibernate. Mr. Sanderson explained why he choose Linq to SQL and his reasons are valid. Another equally small criticism was with mixing CSS styles with HTML in the Shopping cart example. He took great pains in the rest of the application to use best practices but took the easy way on this sample. Obviously if these are the biggest criticisms I can give the book, the book is pretty amazing. I strongly recommend the book and is one of the best programming books I have purchased (and I have purchased many).
So, all my comments below shouldn't dissuade you in any way from getting this book as soon as possible!
1. I read first version of this book after I went through Nerd Dinner tutorial. I think a "quicker-and-dirtier" example like Nerd Dinner would be helpful before you get into unit testing, dependency injection, and other advanced topics. Especially if your background is in WebForms! Unfortunately, Scott's team seem to have taken extended vacation after MVC2 and VS2010 went live in April. All the tutorials are still covering MVC1 (as of mid-July 2010).
2. Just like somebody else noted, I would prefer to use EF over LINQ to SQL. I understand author's arguments; I just disagree with them. Most developers are upgrading the tools very quickly (unlike OS or business applications the concern about backward compatibility just isn't there). There are a lot of issues that are at intersection of EF4 and MVC2 - having example that use both would be just awesome! More generally, I think there is too much concern (and space) dedicated to VS2008 issues.
3. Author chose Ninject for DI examples... It feels from conversations that I had that Castle Windsor is more popular.
4. It seems to me that every MVC project is using T4MVC (and for good reason... magic strings are EVIL). Would be nice to see it incorporated in the book!
5. As I said, this is one of the best (if not the best) books on the topic. Would be nice to have a forum where the readers can discuss some topics, help each other, and maybe make suggestions or enhancement requests. If such forum exists - I couldn't find it.
1. Using NInject as a DI container.
2. Building custom filters. Including authorization filters.
3. REST style programming in [...] MVC.
4. Areas and how Areas and namespaces interact.
5. Evaluation of the usefulness of HTML Helper methods in MVC Futures and how to use them.
6. Building your own HTML Helpers.
7. Templated View Helpers
8. Using Model Metadata with [...] MVC including how to create your own metadata.
9. How to explicitly call Model Binding (important for testing).
10. Custom Model Binders.
11. Custom Validators.
12. Building Wizards
I particularly like that Sanderson is willing to give advice on using MVC even when it is at odds with the current orthodoxy. For example, if you have most of your logic in the model, you may be better off building UI integration tests rather that Unit Test of your controllers. In general, I found his recommendations make alot of sense. Overall this is a great book, my only wish is that I had it four months ago.
The 3 things I love about this book are Structure, Testing, and Details.
This book does an excellent job of conveying the proper structure of an MVC application. It presents the philosophy and then detailed examples. This book will teach you the best way to structure your application so you don't waste any effort doing it the wrong way.
Secondly, a huge emphasis is placed on how you can test all the parts of an MVC application. For every piece that you build, you are given an example of how you can test it. These tests are placed conveniently is Side-Bars so that the test-savvy can quickly skip over them if needed.
Finally, every feature, class, hook-in point is explored in sufficient detail that you know exactly how they work and when you want to use them. Cookbooks like to give you 3 examples of how to do the 3 most common things. This book provides you with the foundation to accomplish anything.
I like to read a book from cover to cover and am about half way through this one. I felt a bit overwhelmed when I read the chapter on Routing. But after playing with routing for a little why, I went back and reread it and said "Ah-ha! I get it now. Ahhhhh... so that's how that works. Cool!" I am experiencing the same feeling in the chapter on Models so I'm giving a little time to sink in and then I'll go back and read that one again.
This book answers every question I can think of. The only drawback is that at 600+ pages, sometimes it took a little while to find it.
Look for similar items by category
- Books > Computers & Technology > Internet & Social Media
- Books > Computers & Technology > Microsoft > Development > .NET
- Books > Computers & Technology > Programming > Software Design, Testing & Engineering > Software Development
- Books > Computers & Technology > Web Development > Programming
- Books > Textbooks > Computer Science & Information Systems > Computer Science
- Books > Textbooks > Computer Science & Information Systems > Programming Languages
- Books > Textbooks > Computer Science & Information Systems > Software Design & Engineering