Architecting Architects

by Jacob 29. August 2007 05:40

plans In many companies developer career progression is deceptively straight-forward; Jr. Programmer, Programmer, Sr. Programmer, Team Lead, Architect, Sr. Architect, Bob (Bob being the semi-mythical entity referred to in obscure comments, worshipped by now-extinct aboriginal tribes, and rumored to haunt the sub-sub-basement).

The differentiation between these positions starts off with how much you know. A Sr. Programmer is a Jr. Programmer who knows his tools inside and out and can complete assigned tasks quickly and without a lot of supervision. Around Team Lead time, however, progression stops being about what you know and starts revolving around your ability to choose wisely between competing trade-offs.

This is an easy transition to miss if you aren’t paying attention. Indeed, I’ve known "Architects" that I wouldn’t ask to design a "Hello World" application. Because being a good architect is about developing good judgement, there are two things that are essential to becoming and remaining competent.

Know Your Stuff

Yeah, I know I just said that being an architect isn’t about what you know. That’s only slightly true. What changes between Sr. Programmer and Architect is the depth of your knowledge—you have to penetrate to the reasons and complexities behind patterns, practices, and technologies. You go from knowing what an n-tier architecture is (and how to create and maintain one) to understanding why that architecture was invented, what problems it solves, and what costs are involved in creating and maintaining one.

Take, for example, the "architecture" I found in coming to a new position. A number of projects are used for this intranet application, each in its own application space. Here’s a short illustration of the structure of two of the solutions.

Tiers

As you might guess, BOL stands for "Business Object Layer", DAL for "Data Access Layer", and OBJ for "Objects". You might not be surprised, given the closely related project names, to learn that each project contains classes that exist in the other. In short, despite having the structure and using the terminology of n-tier architecture, this isn’t actually anything of the kind.

The developer responsible for this design is not an architect, no matter how much experience he may have, because he has failed to understand when and why you would use an n-tier architecture. Understanding the reasons behind n-tier architecture would make it impossible to create this structure.

Understanding architecture takes hard work. It requires more than reading blogs, attending conferences or purchasing books (though each of those are certainly useful in developing understanding). True understanding requires thinking things through and asking tough questions. It requires breaking down concepts until you can identify and understand their component parts. Often, it takes asking the questions that risk confronting a room full of people glaring at you in varying degrees of shock. Most of all, it takes admitting that you might not know something and working to rectify that lack—or, harder still, being willing to re-examine assumptions (or even conclusions) when presented with new information.

The Development Twins: Cost and Benefit

It’s easy to forget that every technology, architecture, and practice has two sides; a cost and a benefit. To borrow from Heinlein, "There ain’t no such thing as a free lunch." Because making choices is hard, it’s easy for people to remember only one side of a given technology, architecture, or practice—to see only the cost or only the benefit.

This is particularly true in new processes or designs. We go through so many silver bullets at least partially because people teaching new processes tend to concentrate on benefits. This is understandable even if the presenter isn’t financially tied to your adoption of the Great New Thing™ because the benefits are the reason the Great New Thing™ exists. This means that you’ll be taught the benefits, but you’ll typically have to discover the costs on your own.

It’s also important to bear in mind that developers have a natural bias towards solving problems, not finding them which leads to a tendency to grasp benefits quickly. Because architects are grown from developers, it’s important to examine and balance this potential optimistic bias. And it is a balance. Ask an average Linux geek about Microsoft if you want to see a bias towards cost.

The Scope Multiplier

A project’s scope has a multiplicative effect on both cost and benefit. Understanding this became explicit for me in a reply I made to a recent comment by Udi Dahan.

I’d be willing to bet that the benefits of DI, SoC and other good design practices increase exponentially with the number of developers while their costs are a linear progression. Huh. That bears some thought...

For any given process, you need to understand how both benefit and cost are affected by the scope of your project. Practices that scale benefits exponentially and costs linearly are excellent when the scope is large. Indeed, the larger the scope, the better the net gain from applying the given practice.

A corollary of that evaluation is that practices designed for large scales are less likely to provide a net benefit in a small team with a small project.

It’s possible that project scope can be calculated separately for project complexity and team size, but I’d have to give that some more thought. Since high complexity projects tend to require larger team sizes, you’d seldom have one without the other (making this a moot conjecture). That said, my initial instinct is that something like n-tier is more important vs. complexity whereas the benefits of SoC scale more based on team size (though it helps mitigate complexity as well). It is possible that this difference may play an important role in how and when you’d apply each.

Time

That pesky fourth dimension can also have a dramatic effect on cost and benefit. A quick down-and-dirty project with limited scope may seem like it wouldn’t benefit from any real architecture at all. That evaluation can change drastically if the project is likely to change a lot over time. Most developers have been ambushed by application maintenance at some point because they hadn’t planned adequately for change.

Predicting the future is a dubious pursuit at best, however, so be careful here. There’s a reason YAGNI became a well-recognized acronym. Don’t forget that a project can be refactored into a useful pattern after the fact if circumstances change to warrant it—particularly if you have prepared for easy refactoring (unit testing, anyone?).

The biggest problem with evaluating the effect of time on your project is that it is literally impossible to measure the impact of the choice not taken. As a result, I’m always very careful when I hear something like "If only we had..." or "Good thing we...". Personal, anecdotal experience is error prone at best—something to keep in mind during project postmortems.

The Courage to Choose

The most important thing an architect does is decide. The architect chooses the technologies, the patterns, and the practices to apply to a given software development problem knowing that success and failure can hang on the effects of those choices. That’s a lot of responsibility. The impulse to push your choice off to a vendor, or some guru’s public statements, or industry consensus is a seductive one that can work for a time. Reality being the harsh b**tch she is, however, it isn’t a safe impulse to indulge. Personally, I prefer to hold my fate in my own hands.

Tags: , , , , , , , ,

Management | Programming

Comments


August 31. 2007 10:23
Nate Kohari
Good article. There seems to be an idea about software architects that they sit in ivory towers and speak edicts unto the unwashed masses of programmers. (Thou Shalt Use ORM!)

I'm sure it differs between companies, but in my role as architect it's my job to understand the ramifications of design decisions, and guide the overall construction effort of projects accordingly. This means that I need a very deep understanding of the technologies that we used -- and by extension, that means most of my free time is reading as much information as possible to aid me in making sound decisions.

I just shake my head when I hear about software architects that don't code. That's completely insane, in my opinion... how can you possibly hope to understand technology when you haven't gotten your hands dirty with it? If you allow a non-coding architect to design your project, you'll end up with an "architecture" like the one you showed in the screenshots. (A crappy one.)

The grand majority of my time is still spent in front of a keyboard, not in front of a whiteboard -- and I wouldn't have it any other way.


September 13. 2007 00:18
Greg Young
Just a quick comment ... having that duplication you showed above at times is actually a good architectural decision. In this case it probably isn't Smile but there isn't enough shown.

[For reference see context mapping in DDD]

Nice post!

Greg


September 13. 2007 02:38
Jacob
@Greg: Thanks. And nit-pick accepted. If the domain separation entered into the picture, then there could be a point where that kind of duplication was called for. Indeed, these two projects would likely be considered separate domains if such an analysis took place because inventory and purchasing, while related, are tangential to one another and tend to use the same terminology for separate functions and in disparate ways.

That said, if you're going to have an access layer and a data layer and an object layer and you aren't even going to put each in their own library and/or name space, then you need to have Visual Studio taken away from you while you write a 5,000 word essay on why you should be allowed to touch computers again.

I'm just sayin'...


September 13. 2007 03:09
Greg Young
as I said "In this case it probably isn't Smile but there isn't enough shown."

but ... *puts on 'it all depends hat'* one could make an argument for same assembly deployment but conceptual decoupling. Let's propose for a minute that the data layer was injected into the domain through  configuration and that the 'DAL' was a default implementation of those interfaces which could be overriden by reimplementation and configuration (ala DI such as windsor).

There could be some associated trade offs (what I like to call 'mort usage points') that would make someone lean towards such a design....

Now I am not saying that I would or that the person writing this even had such thoughts enter their mind (it is my sneaking suspicion that they were focused on the how-to-do-this not the how-to-do-this-well and saw such a thing in an article/on the web). Perhaps it originally came   including disclaimers, perhaps not ...

just pointing out again (as you have so eloquently above) that 'it all depends' ..

Cheers,

Greg


September 13. 2007 03:10
Greg Young
missed this ...

"and/or own namespace"

I would have guessed they were since VS by default namespaces off of folders :-/


September 13. 2007 20:44
Jacob
Yeah, I play the depends game, too. In this case, it's just a bigger stretch than usual is all.


September 13. 2007 21:53
Greg Young
Smile


September 29. 2007 03:56
Arnon Rotem-Gal-Oz
Good article
I think, however, that you can help yourself become a better architect buy learning about better design, more programming perspectives etc. (I suggest such program here: www.rgoarchitects.com/.../...TrainingProgram.aspx)
The point is that while the change is internal, having knowhow at your disposal can help you make that change. Also you don't have to experience everything yourself and should learn from others if possible


October 1. 2007 16:30
Jacob
@Arnon: Good architects know their stuff, true. That's my first step to becoming a good architect above. Knowing is only the start however.  Knowing more isn't going to help you at all if you don't develop the ability to use what you know wisely. Putting a definitive set of courses together is fine, but your post puts too much emphasis on facts and not enough on developing judgement.

And I admit that this post is problematic because developing good judgement is hard and teaching it is harder still. This is evident by how many of the courses for architects teach methods and patterns while none of them teach trade-offs. Frankly, at this point, I'd be more interested in a class titled "When not to use SOA" or "The limitations of BDD". Not that I have anything against either. I certainly don't. It's just that developing judgement means learning to weigh alternatives and that can't happen unless you first develop a sense of environment, cost, and balance.

Comments are closed

Information

    Recent Posts

    Calendar

    <<  September 2010  >>
    MoTuWeThFrSaSu
    303112345
    6789101112
    13141516171819
    20212223242526
    27282930123
    45678910

    View posts in large calendar
    Disclaimer
    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2010 Scruffy-looking Cat Herder