Supplemental files and examples for this book can be found at http://examples.oreilly.com/9780735662841-files/. Please use a standard desktop web browser to access these files, as they may not be accessible from all ereader devices.
All code files or examples referenced in the book will be available online. For physical books that ship with an accompanying disc, whenever possible, weve posted all CD/DVD content. Note that while we provide as much of the media content as we are able via free download, we are sometimes limited by licensing restrictions. Please direct any questions or concerns to .
Introduction
Get your facts first, and then you can distort them as much as you please. |
-- Mark Twain |
Until late 2008, I was happy enough with Web Forms. I did recognize its weak points and could nicely work around them with discipline and systematic application of design principles. But a new thing called ASP.NET MVC was receiving enthusiastic reviews by a growing subset of the ASP.NET community. So I started to consider ASP.NET MVC and explore its architecture and potential while constantly trying to envision concrete business scenarios in which to employ it. I did this for about a year. Then I switched to ASP.NET MVC.
ASP.NET was devised in the late 1990s at a time when many companies in various industry sectors were rapidly discovering the Internet. For businesses, the Internet was a real breakthrough, making possible innovations in software infrastructure, marketing, distribution, and communication that were impractical or impossible before. Built on top of classic Active Server Pages (ASP), ASP.NET was the right technology at the right time, and it marked a turning point for the Web industry as a whole. For years, being a Web developer meant gaining a skill set centered on HTML and JavaScript and that was, therefore, radically different from the skills required for mainstream programming, which at the time was mostly based on C/C++, Java, and Delphi languages. ASP.NET combined the productivity of a visual and RAD environment with a component-based programming model. The primary goal of ASP.NET was to enable developers to build applications quickly and effectively without having to deal with low-level details such as HTTP, HTML, and JavaScript intricacies. That was exactly what the community loudly demanded in the late 1990s. And ASP.NET is what Microsoft delivered to address this request, exceeding expectations by a large extent.
Ten years later, today, ASP.NET is showing signs of age. The Web Forms paradigm still allows you to write functional applications, but it makes it harder and harder to stay in sync with new emerging standards, including both W3C recommendations and de facto industry standards. Todays sites raise the bar of features high and demand things like full accessibility, themeability, Ajax, and browser independence, not to mention support for new tags and features as those coming up with HTML 5 and the fast-growing mobile space.
Today, you can still use Web Forms in one way or another to create accessible sites that can be skinned with CSS, offer Ajax capabilities, and work nearly the same across a variety of browsers. Each of these features, however, is not natively supported and incorporated in ASP.NET Web Forms, and this contributes to making the resulting application more fragile and brittle. For this reason, a new foundation for Web development is needed. ASP.NET MVC is the natural follow-up for ASP.NET developerseven though Web Forms will still be there and improved version after version to the extent that it is possible.
This leads me to another thought. From what I can see, most people using Web Forms are maintaining applications written for ASP.NET 2.0 and topped with some Ajax extensions. Web Forms will continue to exist for legacy projects; Im not really sure that for new projects that the small changes we had in ASP.NET 4 and those slated for ASP.NET 5.0 will really make a difference. The real big change is switching to ASP.NET MVC. Again, thats just the natural follow up for ASP.NET developers.
Who Should Read This Book
This book is not for absolute beginners, but I do feel it is a book for everyone else, including current absolute beginners when theyre no longer beginners. The higher your level of competency and expertise is, the less you can expect to find here that adds value in your particular case. However, this book comes after a few years of real-world practice, so Im sure it has a lot of solutions that may appeal also the experts. What I can say today is that there are aspects of the solutions presented in this book that go beyond ASP.NET MVC 4, at least judging from the publicly available roadmap.
If you do ASP.NET MVC, Im confident that you will find something in this book that makes it worth the cost.
Assumptions
The ideal reader of this book fits the following profile to some degree. The reader has played a bit with ASP.NET MVC (the version doesnt really matter) and is familiar with ASP.NET programming because of Web Forms development. The statement Having played a bit with ASP.NET MVC raises the bar a bit higher than ground level and specifically means the following:
The reader understands the overall structure of an ASP.NET MVC project (for example, what controllers and views are for).
The reader compiled a HelloWorld site and modified it a bit.
The reader can securely tweak a web.config or global.asax file.
Anything beyond this level of familiarity is not a contra-indication for using this book. I built the book (and the courseware based on it) so that everyone beyond a basic level of knowledge can find some value in it. Rest assured that the value a seasoned architect can get out of it is different from the value the book has for an experienced developer.