My programming career started in the mid-nineties as a web developer for a local school district. Web as in http, that is. Netscape Navigator was helping to grow the number of households with internet modems, because it was more advanced than anything else at the time. Netscape Navigator 3.0 (1996), and 3.04 (1997), helped households and businesses all over the world open up the internet for common uses. And there is no more common task than shopping! With the advent of e-commerce, the internet exploded with a capitalist gold rush.
I started web development in the public sector, ironically, where we leveraged the first threads of social networking by allowing school district graduates to collaborate with other former classmates. I started my career on the Microsoft platform using IDC (Internet Database Connector) with HTX (HTML Extension Template). Internet Information Services (IIS) 2.0 gave us fantastic flexibility against ODBC data sources. This was my first use of the “code nugget,” or <% %> delimiters. IDC/HTX gave way to Active Server Pages (ASP), and I can still recall following the breaking changes from ASP 2.0 to ASP 3.0 as well as the awesome COM+ integration when it was introduced. I dabbled in CGI, Perl, Java, and C++ along the way, but I stayed with the Microsoft platform. I observed the Visual Basic explosion largely from the sidelines, although I did learn the ropes with some small utility apps.
ASP 3.0 saw the browser wars with Internet Explorer 4, released with Windows 95, duking it out with Netscape for browsing market share. Writing web applications that worked well with both browsers was brutal. IE 5.0 opened up the horizons for intranet applications with proprietary web extensions like the XML data island that would dynamically bind to tables with the datafld=“” attribute. Client-side scripting was proprietary, and many companies mandated IE just to get the advanced functionality. IE 5 and IE 5.5 were the main browsers on the Microsoft side of the dot-com boom. Windows XP shipped with IE 6, which effortlessly captured the majority of the web browser market.
During this time, most web developers building business systems had to make a choice of which browser to test with. For public sites, there were many pages that had to be coded twice. For intranet, the application likely only worked in IE. ASP 3.0 put the programmer intimately in touch with HTTP, HTML, and the GET and POST verbs. CSS was still in its infancy, and the <blink> tag was fading in popularity. I remember pulling out crude frameworks to handle multiple request paths from the same ASP script.
At the same time that ASP 3.0 was enjoying widespread adoption, Struts was taking the Java web application world by storm. Struts was probably the most well-known Java MVC framework, although today, in 2012, there are many popular ones for the JVM. With ASP 3.0, I was largely unaware of the lessons my Java counterparts had already learned, although I certainly felt the pain of having all the responsibilities lumped into a single ASP script.
I adopted ASP.NET 1.0 right out of the gate and converted some of my ASP 3.0 sites to Web Forms. Remember when GridLayout was the default, with CSS absolute positioning everywhere? It was very clear that Web Forms 1.0 was geared for VB 6 developers coming over to .NET and getting onto the web. The postbacks and button click handlers were largely foreign to me, but my colleagues who were seasoned VB 6 coders were right at home. ASP.NET 1.1 dropped the GridLayout and forced the developer to understand HTML and how flow layout works. Downlevel rendering was great when IE was the “preferred” browser, and everything else was downlevel. That paradigm started to break as Firefox climbed in market share and demanded standards-compliant markup. We learned we needed to declare our DOCTYPE, and we no longer wanted downlevel rendering, so we turned that feature off.
I became an ASP.NET Expert and was a frequent blogger during the .NET 2.0 beta cycle. I knew every feature and every breaking change from ASP.NET 1.1 to 2.0, and I helped my team adopt 2.0. During the ASP.NET 2.0 era, I started following Martin Fowler and his Model-View-Presenter writings. I implemented that pattern to pull away logic from the code-behind file, which had become quite bloated. Java developers, in 2005, were enjoying a choice of several MVC frameworks for the web. I, on the other hand, was wrestling Web Forms into Model-View-Presenter and test-driven development submission. It was exhausting, but what was the alternative?
In 2006, with a job change, I jumped straight over to smart-client development with WinForms. With the similar clunkiness of the code-behind model, and with a development team to manage, I implemented the Model-View-Controller pattern with the WinForm class as the view. It was a breath of fresh air. UI development was seamless, and the controllers were a natural boundary from the domain model to the UI. In 2007, I jumped back into web development and begrudgingly implemented Model-View-Presenter with WebForms again. In retrospect, I wish I had adopted MonoRail, another Model-View-Controller framework for .NET.
In March of 2007, Scott Guthrie (@scottgu) created a prototype of what would become the ASP.NET MVC Framework. Mr. Guthrie had heard from many customers about the difficulties with Web Forms and how they needed a simpler, more flexible way to write web applications. At the 2007 MVP Summit, Mr. Guthrie sought input from a small group of Microsoft MVPs. The group, made up of myself, Darrell Norton, Scott Bellware, and Jeremy Miller, validated the vision of his prototype and gave some initial input that would end up being coded into the framework.
When Scott Guthrie presented a working prototype and vision for ASP.NET MVC at the AltNetConf Open Spaces conference in October of 2007, I instantly knew that this was what I wished I had had all along. Being a long-time web developer, I understood HTTP and HTML, and this, I believe, is what ASP.NET 1.0 should have been. It would have been such a smooth transition from ASP 3.0 to ASP.NET MVC. I can claim the first ASP.NET MVC application in production, when I convinced Mr. Guthrie to give me a copy of his prototype. I revised my http://www.partywithpalermo.com registration site and launched it in November of 2007 on one of Rod Paddock’s servers at DashPoint.
When Manning Publications approached me to write a book on ASP.NET MVC, I was already a frequent blogger on the topic and had already published an article on the framework in CoDe magazine. Ben Sheirman, Jimmy Bogard, and I worked on ASP.NET MVC in Action for over a year, and I was very excited to see it published and very well received by the developer community. Microsoft continued to release incremental previews of the next version, ASP.NET MVC 2. For the second edition, we brought on two new members to the author team: Eric Hexter and Matthew Hinze. The five of us started working on ASP.NET MVC 2 in Action in late 2009 with framework knowledge we cultivated in the field and experience as authors that we’d gained writing the first book.
With ASP.NET MVC 4 in Action, Ben moved into iOS development, and Jeremy Skinner joined the author team, bringing his vast knowledge as an MvcContrib committer and ASP Insider. This edition comes at a time when HTML5, CSS3, and jQuery are surging in popularity. ASP.NET MVC further integrates jQuery and provides more support for JavaScript, which is seeing increased adoption with other frameworks like Node.js and Backbone.js.
What Microsoft did with the ASP.NET MVC release cycle was unprecedented at the time, compared to previous projects in the Developer Division. The project was released at least quarterly on the CodePlex site, source code and all. It was also developed using test-driven development as the software construction technique. Full unit-test coverage is included in the source code download, and ASP.NET MVC was released under the Apache open source license. If you choose to do so, you can now submit a pull request directly to the ASP.NET team!
ASP.NET MVC works the same way the web works. It’s a natural fit. Although Microsoft was the last to the table with a Model-View-Controller framework for their development platform, this framework is a strong player. Its design focuses on the core abstractions first. It is also conducive to extension by the community. In fact, the same week the first Community Technology Preview (CTP) was released, Eric Hexter and I launched the MvcContrib open source project with an initial offering of extensions that integrated with the ASP.NET MVC Framework. MvcContrib was subsequently accepted as the first community project by the CodePlex Foundation, a group that facilitates corporate contributions to open source.
ASP.NET MVC is a frequently used tool at Headspring, where I manage the consulting practice. For the .NET industry as a whole, in 2009, I predicted that ASP.NET MVC would be considered the norm for ASP.NET development by 2011. Now that 2011 has arrived and gone, that prediction has come true. New developers are coming to the .NET platform every day, and for web developers, ASP.NET MVC is much simpler to ramp up on. Because of the decreased complexity, the barrier to adoption is lowered, and because of its simplicity, it can grow to meet the demands of some of the most complex enterprise systems.
Meanwhile, this framework has been of direct and immediate benefit to our client projects. Leveraging the framework on client projects has definitely helped increase the quality of information contained in this book, because the book is based on hands-on experience. We have seen successes, and we have found some things that don’t work. We’ve brought these lessons to bear in this text for your benefit, and we hope that this book will stay with you even after you have written your first application.
Although other platforms have benefited from Model-View-Controller frameworks for many years, the MVC pattern is still new to many .NET developers. This book explains how and when to use the framework as well as the theory and principles behind the pattern and complimentary patterns. We hope that this book will help enlighten you about an indispensable technology that’s very simple to learn.
Jeffrey Palermo