The Accidental Architecture

Bill Venners: To tackle the cost of change curve, you found a way to make it practical to make changes all the way through the lifetime of a project. And that made it less important to plan for the future, because you could make changes when they were actually needed as the future unfolded. Does an overall architecture simply emerge through the process of focusing only on each small step?

Ward Cunningham: I like the notion of working the program, like an artist works a lump of clay. An artist wants to make a sculpture, but before she makes the sculpture, she just massages the clay. She starts towards making the sculpture, and sees what the clay wants to do. And the more she handles the clay, the more the clay tends to do what she wants. It becomes compliant to her will.

A development team works on a piece of code over several months. Initially, they make a piece of code, and it's a little stiff. It's small, but it's still stiff. Then they move the code, and it gets a little easier to move. In a project I mentioned earlier [in Part II], we added a schema evolution capability to our database. It softened up the program. It was much easier to change. Every time we did a schema change and we got better at it. The programmers and the code—as a unit—softened up. We worked the program, and we kept it flexible.

At the end of the project you have done everything that needs to be done—everything that somebody has paid for anyway—and you look at the code and ask, "What is in the core of this lump of stuff?" You ask, "How did it turn out? After we worked the program day in and day out, how did it end up?" Often, the program ends up amazing. You'll say, "This is beautifully architected." Well, where did that architecture come from?

In this case, architecture means the systematic way we deal with diverse requirements. Architecture allows us, when we go to do work we need to do on the program, to find where things go. It is a system that was worked into the program by all the little decisions we made—little decisions that were right, and little decisions that were wrong and corrected. In a sense we get the architecture without really trying. All the decisions in the context of the other decisions simply gel into an architecture.