xv
Introduction
I started down the road of building a content management system (CMS) as a direct result of the
experiences I had working with another custom CMS in my day-to-day work. A handful of design
decisions made at the conception of that system years ago greatly impacted the CMS from a
development standpoint; some things worked exceptionally well, some things needed additional love
and care to achieve the results we really wanted, and some things were outright broken.
As usual, hindsight is 20/20; although the system had carried us for years, the code base was so huge
and so intertwined that rewriting it was the only cost-effective solution. Even simple maintenance tasks
and feature development were increasingly resource-prohibitive. I set off on a skunkworks project to
create the CMS while the remaining developers kept the existing one chugging along.
It’s a truly difficult decision to throw away code. A lot of developers worked on the previous CMS
over the years, and a completely new system brings with it a unique set of challenges. I wasn’t only
throwing the old code away; I was throwing away the applied project experience, the accumulated
developer-hours spent working with it, and so on. It’s the shortest path to incurring significant design
debt that I can think of, and incur I most certainly did: the CMS was developed from the ground up over
the course of approximately a year.
The end result is a CMS that the development team is happier working with, that management can
trust will be stable and dependable, and that users find both responsive and fully featured. It’s not
perfect, but luckily, no system is. If there were such a thing, someone would’ve built it, and we’d all be
out of jobs. What I’ve tried to do is build a system that met the evolving business needs of my
organization and write a book to accompany it that acts as a guided tour of both the new .NET features
and how they click together in the context of a CMS. It has proven to be a very interesting ride, indeed.
A tremendous benefit to the creation of both the system and the book was the early preview and
beta of Visual Studio 2010 and .NET 4.0. Case in point: as you’ll see, the new Managed Extensibility
Framework makes up a significant part of the business logic in the CMS (and VS2010, which uses MEF
for its add-on capabilities). Could the CMS have been built without .NET 4? Of course, it could have
been, but I would venture to say that it would not be as robust or as feature-complete given the
timeframe.
I can think of a dozen ways to accomplish any of the results shown by the CMS in this book. What I
have attempted here is to demonstrate the methods that worked for me in a production environment,
using a system that is concrete rather than theoretical, and with the newest technology Microsoft has to
offer as the method of transportation.
About This Book
This book is fundamentally a companion text as much as it is an introduction. A content management
system is a nontrivial piece of software with many “moving pieces.” As such, it would be next to
impossible to document the usage of each and every line of code in a meaningful way while still giving
adequate coverage to the topics new to .NET 4.0.
In terms of structure, each chapter introduces a new topic of some sort, breaking down the core
concepts quickly using small, straightforward examples. The remainder of the chapter is used to
demonstrate how those concepts were applied to solving the challenges that building a CMS presents.