Architecture in a Box
Programming used to be about moving bits, so programmers memorized the power of 2 and ASCII or EBCDIC. Then it was about control flow, and programmers learned how to loop over an input deck and perform an operation for each element of the deck (and how to handle the pesky EOF case, which may force you to read twice from the file). Then it became about data structures, and programmers learned how to build their own linked lists of records, trees of records, traversals, and so on. But advances in programming languages and environments have made most of that knowledge obsolete, even dangerous. Today, programming is about design and architecture. But are advances in frameworks making this knowledge irrelevant as well?
My first thought is no. Good design and good architecture is an art form, and it takes practice to get it right. Even then, it is not always clear what “right” is, since design is a matter of handling many different tradeoffs. How can a box help?
But after giving it some thought, I’ve decided that modern frameworks do, in fact, help to solve typical architectural problems. A good example of that is the Struts framework, which defines clear roles for a model, view, and controller, right out of the box. While it is possible to screw this up, the existing classes make it much easier to do the (usually) right thing and harder not to.
I ran into an interesting case of this recently. I’d been taking a look at Adobe’s Flex platform, and I found its control model to be incredibly confusing. A former student suggested using the Cairngorm MVC framework. Although skeptical at first, I have now become convinced that this is a good thing. What changed? He showed me his architecture for communicating with a server that managed all the application’s state. His architecture was much cleaner than a similar architecture that I had helped to design in a different product. The Cairngorm skeleton provided a good foundation on which to build a good, clean architecture. What can you say? It really is as close as you can get to having an architecture in a box.
It pains me to say it, but maybe, just maybe, frameworks will do to architecture what modern programming languages have done to data structures. Sure, it’s nice to know about them, but by and large, you can be a successful developer with only a superficial understanding of them.
Leave a Reply
You must be logged in to post a comment.