Tuesday, August 30, 2011

The Permanence (or Not) of Software Architecture

There is a series of rants in software blogs about software architecture not being the same as building architecture. (http://bexhuff.com/software-architecture-is-not-building-architecture , http://triebert.nl/downloads/072005_swarm_concluding_paper.pdf ). The basic theory is the buildings are permanent where software is ever-changing.

I’m reading a book that throws this theory on its head. How Buildings Learn is subtitled “What happens after they’re built”. I live in a section of Massachusetts that has many old mills. The mills, beautiful sturdy buildings were falling down. An effort was made to rework them and now we have condos, restaurants, and businesses in these beautiful red brick buildings.

And although I agree that software architects are not building architects, we’ve been building for thousands of years and we’ve been creating software for 60 years at most. The book’s author agrees with the software people that buildings are not designed to adapt, but all buildings “adapt anyway, however poorly, because the usages in and around them are changing constantly.”

This line could also be applied to software. How many cases can you think of where the software was designed to do one thing but was called on to do another in later revisions? My team spends a lot of time figuring out what will be or could be desired in the future so we don’t break any needed extensibility. This is the Open-Closed Principle which states: Software entities like classes, modules and functions should be open for extension but closed for modifications.

Several famous building architecture quotes from the book can be examined in the software world. “Form ever follows function”, said by Lois Sullivan, a Chicago high rise designer in 1896 implies that we can always determine function. In software we can’t. In fact with Agile processes, we focus only on the needs at hand, not what could be (because it may never come to be).

Winston Churchill said “We shape our buildings, and afterwards our buildings shape us”. The author points out that this goes on forever. Yes we shape our buildings/software, then they shape us, and then we shape them again, etc. This reminds me of putting software in the marketplace, getting feedback, and then reworking the software to meet the needs of the customer.

“Flow, continual flow, continual change, continual transformation” is not part of the Agile Manifesto although it sounds like it could be. It’s how a Pueblo Indian, Rina Swentzel, describes her home village.

The book points out that more is being spent on changing buildings than building new ones. Most software engineers I know work on older systems modifying them versus building something brand new. The changes in old buildings are caused by three forces: technology, money, and fashion. In software, technology is a huge force in the design. No one would argue that. Money/ schedule/ resources also have more effect on software architecture than anything else in my experience. How many times have you not been able to do it right because of time/money/resource constraints?

Fashion is defined in the book as “non-functional stylistic dynamism”. There are certainly these pressures on software architecture – government regulations, software processes that go in and out of fashion, design patterns, etc. all effect software.

Three types of buildings are mentioned in the book – commercial, domestic, and institutional. I think there are also three types of software bodies – web, start-up and/or open-source, and larger companies/institutions. Commercial/web applications adapt quickly and radically due to intense competitive pressure. Domestic buildings/ start-up code bases or open source change steadily due to direct feedback from the family/customers and designers. Institutional buildings/software bases are slower to change there is reluctance and delay but they do eventually change.

But what in a building or software architecture project actually lasts or does not change? What makes it become loved? In a building, it is age. We have a module in our system that has been around since the beginning and has not changed much. I’m not sure it is loved or admired. But I secretly admire it - there isn’t much in the software world that survives the way an old grand building survives. The module is simple, extensible, and easy to learn.

So while I’ve always believed that Software Architecture is not permanent, I’m beginning to think we can learn more from the building architects. I will be blogging further abut many of the chapters in this book which I found on: http://www.accreditedonlinecolleges.com/blog/2011/20-educational-architecture-books-anyone-can-enjoy/