Saturday, December 02, 2006

Java Architecture Exercise

"Architecture is a science, arising out of many other sciences, and adorned with much and varied learning: by the help of which a judgement is formed of those works which are the result of other arts."
---Vitruvius, Roman architect circa 40BC (requoted from Wikipedia)

Whever anyone asks me to review or define an architecture, the first thing I am reminded of is something Grady Booch said in a lecture I attended once: " What is an architect? An architect is someone who thinks up really cool ideas and gets someone else to create them!"

Hmmm...very often the "genius" of the architect gets lost in translation, and I end up reviewing code that leaves me thinking that an architect is someone who causes trouble...well, at least in software engineering.

To me an architect is someone who can create, critique, compare, contrast, measure, quantify, qualify, rareify, etc. etc., an "architecture". So what is an architecture (in software)? Again, to cite Grady: "Every system has an architecture. Some are not so pretty." In other words, there is no system without an architecture, and conversely, no architecture without a system. One cannot exist without the other.

As an aside, let's consider the most well-known architectural disciplines --- that of building construction. Here, architects are legends and architectures are obvious! No one would ask: What is the architecture of the White House, or the Empire State Building, or even my house. There are categories, and periods, and patterns, and styles that define an architecture for buildings in telescoping detail. As much or as little detail as is needed for the discussion. If you are a constrcution engineer, the architect drops detailed and standardized (digitized) drawings. If you are an interior decorator, you need only define the style and period perhaps. But everyone knows what it is and why and what makes something a good architecture, and what makes it bad (though taste and preference come into play, anyone can articulate WHY they prefer one to another.)

None of this is true today in software. So back to the question: what is a software architecture. The short answer: the set of constraints on a system's design, and therefore code. The long answer: it depends.

Today's exercise will be one of those "depends" cases. Someone dropped a huge pile of Java code on me and asked me to 1) define its architecture, and 2) redefine a better architecture. Note, that there was no definition of what "better" was. So join me if you will on this excursion through time and space...(check back soon)


Anonymous said...

software architecture, as far as i can understand, it is more political system relevent, in terms of social life.

Rome, actually USA is now using Rome system, seems quite good for federal system but definitely sucks in Asian countries where people like to have a powerful central government.

whatever, federal system will make every subsystem in the way autonomous. however Asian system will not allow this.

software system has the same logic.

Robert A. Ficcaglia said...

A very interesting perspective. I suspect that most commercial software could best be characterized in this way as despotism or anarchy!

The ideal system, in terms of a political analogue, would in my opinion be a socialist democracy: true independence of the individual (objects or services) with the assistance of shared resources ensure a smooth overall government.

The problem with a federal system, whether Rome or the US, is that the problems of a few are disproportionately represented by a small but vocal minority. In software terms, think of a process that consumes more than its fair share of resources, or has a security flaw which exposes the whole system.

In a decentralized, more democratic system, failures are isolated, messages are asynchronous unless absolutely necessary, and the individual can specialize.

Whether a software architect can truly apply a political science degree to the practical problems of engineering systems is left as an exercise to the reader :)