What exactly is software architecture? We, as developers, talk a lot about it. But what does it really mean? Architecture is a word borrowed from the building industry. It is the art and practice of constructing buildings. Software architecture, by comparison, is the art and practice of building software systems. If you think about the practices associated with building architecture, there are many parallels to software architecture.
Building Principles
Some of the earliest writings about architecture by the Romans discussed how buildings should satisfy three principles: firmness, commodity and delight. Today, we’d call these durability, utility, and beauty.
In the software world, this might look like this:
- Durable. A software system is free from bugs, recovers gracefully in the face of errors and is resilient to the inevitable problems.
- Useful. It provides a service that is useful. The system helps people in some way, whether its managing your finances, connecting with other people, or just performing a mundane mathematical calculation.
- Beautiful. The system is elegantly built. It appeals to our sense of aesthetic about how code should look and feel. For me, this manifests itself as simple, clean code, clearly written, with an attention to detail.
Difficult to Change
When you hear the word “architecture”, perhaps you imagine the Greek Parthenon, Frank Lloyd Wright’s Falling Water, or the Guggenheim Museum? The architecture of a building defines its look, feel, and the way you interact with it. Once built, it’s difficult to turn a colonial style farmhouse into a mid-century modern home. You might be able to change the paint color, or rearrange the furniture, but you’re basically stuck with the way the building was built.
Similarly, the architecture of a software system can be difficult to change. If you have a huge, monolithic application written in Java, turning that into a microservice architecture written in Ruby is a major undertaking. It’s almost easier to knock the whole thing down and rebuild from the ground up.
Remodeling is Refactoring
This isn’t to say that you can’t change things, but making major renovations to a building can be difficult. Moving a wall or adding a second story requires major structural changes. The main test of the building, supporting itself without falling down, must be maintained throughout the remodel.
Major refactorings in software may be easier than remodeling a house, but there’s still a transition period. If you’re changing out your data store, you may have to write to both for a while, shoring up the existing structure while you remodel the rest of the code around it. Even smaller scale refactorings, such as maintaining backwards compatibility in a single class require supporting the original APIs while the migration to the new code is completed.
Software Architecture is Architecture
Architecture is a word born in the construction industry. Software architecture, while relatively new, in comparison, is not really that different. It provides the principles used to build software, is difficult to change once defined, and must be supported as it’s extended and modified. The next time you consider your software architecture, hopefully the relationship to building construction will help to make your code that much better.