Saturday, August 28, 2010

Some More Thoughts on Software Architectures

Some month ago I wrote a blog post about some of my thoughts on software architecture and why I think the metaphor of a cathedral is no longer very useful for todays software development. I don't mean that you don't need an architecture when you do agile software development. A good software architecture is absolutely necessary to survive. It is an essential part of each system.

Nevertheless agile software development is based on the idea of embracing change. "Inspect and Adapt" is the secret of success in agile development. The structure of your software emerges over time when you constantly refactor your code. But is this also true for the architecture of the system? Does this architecture emerge over time as well? Or is it adaptable when life changes?

I discussed this a lot over the past years with various people. We typically found two basic contrasting (for this posting simplified) opinions:
  • Opinion 1: The architecture includes the most important technical decisions. It is hard to change those things later on. Therefore the architecture should be defined at the beginning of a project and should experience only minor changes. Major changes in the architecture are considered a bad thing and should be avoided.
  • Opinion 2: The architecture of a system is an artifact that emerges over time. It reacts to change by embracing it. Changing the architecture of a system is considered a good thing and part may be part of your daily live.
While I was always an opinion-2-guy, I always had to admit that some parts of the architecture of a system are hard to change. So changing a large rich-client app to a web-based app might be expensive. The same might be true for changing the implementation language or refactoring a classical three-tier app into a Quasar-like structure.

Then I recorded SE-Radio podcast episode 166 with John Wiegand and listened to him talking about what he calls "Living Architectures":
During the episode he explains the basic architectural decisions behind the Eclipse platform and the Jazz project at IBM. Both architectures are surprisingly simple. They define the general idea of how parts of the system are built and interact. And both don't contain a single word about those things I mentioned above. Even the language is an implementation detail.

The Jazz system is, for example, built around the idea of the web. RESTful services define the heart of the structure. It doesn't matter how those services are implemented, which frameworks they use or how they are internally structured. The whole system might consists out of various languages, various runtime platforms, various infrastructure settings. Even object-orientation becomes an implementation detail of individual services. All things I often thought of being part of the general architecture. But now I know that I was terribly wrong about this.

Of course there are things that are expensive to change. Reimplementing a huge system with a different language might cost you a lot. But the question is: Why do you need to reimplement everything if you switch to another implementation language? The RESTful style, for example, doesn't require such a tight language binding. Its just an example, but it made me think. And it convinced me that "the definition of architecture as the set of things that are hard or expensive to change" leads into the wrong direction.

Architectures are living things. Don't treat them as dead artifacts. And don't be afraid of change. Its a good thing. It reflects your learning. It helps you build better systems.

No comments: