Rearchitecting the Architect

I’ve had this entry in draft mode for a while, and seeing as I am likely to have limited access to the Internet next week, it’s probably best that I get it out there. After all, I believe that all constructive feedback (both positive or negative) is useful.

The traditional software architect role is an interesting one. Developers, who choose not to go down the management line for one reason or another, typically take up this role. Defining what an “architect” does in a traditional software environment seems to be pretty well known. Trawling some job advertisements you see role descriptions like, “translate business requirements into a framework”, “high level analysis and design”, and “technological evangelization”. My observations of a real ‘architect’ at work is that they generally do spike-like work, develop a little (but usually not so little) framework here or there, or suggest implementation patterns in the form of a tutorial or cookbook.

As a mad keen developer, who is into Test Driven Development (TDD), constant refactoring, and evasion of Big Design Up Front (BDUF), I question where does this role fit into newer software development processes? I respect these people, because they have been around for much longer than I have. They probably have a wider repository of patterns to drawn upon and the wisdom of learning from many different projects. I question this, because I think the typical responsibilities fail in an environment that I like to work it.

Architects in their traditional sense, typically fail because they work leagues ahead of the development team. Sometimes they run with BDUF, but other times, they do spike work that sets a pattern for a simple use case, but fails to address the needs of many other ones. Since they rarely look back at the things they have done, architects rarely get any feedback, and one of the most useful of eating your own dog food. It sometimes gets to the point where the architect starts dictating architecture with diagrams instead of actual code, failing to see the difficulties of how untestable or how inflexible it might be when actually implemented!

Here is my revised list of descriptions on the software architect role in a modern software development team:

  • The architect should be an embedded member of the development team – Like it is important to have a customer representative and a tester during an iteration, the architect must be someone a team member can go to for direction relating to a technical feature when unsure. Although it is okay for architects to work on technical spikes in advance, they should also be looking at the implemented result under all real circumstances.
  • Identifying, extracting and naming patterns out of the system – Refactoring code is excellent at a microscopic developer level as you can draw out a better, more maintainable piece of code. Refactoring during an iteration by developers working on stories tend to have too much of a narrow focus to influence a large entrenched system. Excellent test coverage and well-written tests also give the architect an ability to execute on this, without having to leave the code in the state that it is.
  • System-wide Odor Purification – Bad smells reside in code all over the place for one reason or another. Identifying bad smells throughout a system, highlighting them, developing a strategy for getting rid of them, or better yet, actually removing them is important. Once again, developers do this on a microscopic level but similar smells may co-exist in several parts of the system.
  • Mediating technical discussion – Although BDUF is never useful, it is sometimes to useful for a team to talk about different problem solving strategies (a general approach) to take. Reality will always step in and cause something to deviate from a ‘plan’, and the architect should support brainstorming activities and should be able to step in and prevent discussions that become ineffective, and do turn into BDUF.

Gripes with JSP Inconsitencies

It’s frustrating that the

<jsp setProperty="*" name="webJavaBean"/>

does not set nested object properties, yet you call still mix it up with something like

<c:out value="${webJavaBean.complexClass.anotherNestedProperty}"/>.

There’s so much more that can be done with it, instead of having to use the apache BeanUtils class which has its own set of issues.

Think Distance, Not Speed

Somehow I always seem to end up coding the user stories that have the most demanding time constraints. In a way, I feel flattered that someone trusts my ability to deliver when a critical deadline must be met (and real deadlines are very rare in software, despite what everyone tells you), but it is always interesting to see how people react when a critical deadline must be met.

Over the numerous occasions that I have been working on these “time critical” stories, the common question you are normally asked is, “So when do you think we’re going to be done?” or better yet, “Is it ready yet?” As a developer I find it is better to preempt these sorts of questions by delivering feedback earlier than they expect. Typically this means walking through significant, visible progress with the stakeholder, or bringing visibility to issues that are hindering your ability to deliver (e.g. database environments not available, etc). Customers are typically trained to ask “Is it ready?” because they are given such little feedback. The customer should not be surprised when something will be delivered and it easy to forget this.

Another question that you tend to get asked is, “Can you get it done any faster?” Speed is essential to any business, but it is important to highlight what you sacrifice for speedy delivery. Translated into software terms, this may mean less regression tests to provide automated feedback of features breaking when future changes are made, duplicated code, leading to confusion, additional maintenance and even developer shame, or an undesirable path that meets requirements but leads to an unacceptably sluggish solution as load increases. When time is critical, ideally the business should be prioritising which things are more important, but usually it is left for developers (for better or worse).

Achieving your goals as fast as you possibly can is good, but keep in mind that developers are more like runners than they are computers and do get “tired” (for want of a better term). If you want to run a marathon, you certainly don’t run at the same speed as you would the 100m. Instead of asking how fast you can run, the question that should be first asked is how far do you want to go?

Back to Basics: A Retrospective on Retrospectives

Although I am not the iteration manager for our project, I like try to be our project’s conscience (or at least the conscience of whoever our current iteration manager is). Amongst the (many) things I have been reminding our current iteration manager of is the lack of retrospectives. One reason that agile software processes are better off than traditional long running ones is because feedback is a highly valued principle. Small iterations improve the regularity of this feedback which can then be fed back into the process to help the team stay agile with constant changes in the work environment. Retrospectives (post mortems, iteration reviews, etc) are a great way for the team to put together their views and devise strategies for processes that could be improved for the next iteration. The value of small iterations can diminish greatly if no one spends any reflection time to work out whether not things could be done better (and most things can always be done better).

Sailing is a great visual analogy that highlights the importance of retrospectives. On any sailing voyage it generally takes a while to get to its final destination. The navigator is the person whose responsibility is to keep the ship on course for its destination. They also understand the implications if the ship steers off course and is therefore constantly optimising the journey by considering all the questions that could affect the ship’s ability to get there. Are there enough supplies on board? Is there a storm lying ahead of us? Should we visit the exotic island that’s just a little within reach because our passengers would enjoy it? Even if the original journey is never altered, the navigator is constantly asking and reviewing the answers to these questions.

And just like in sailing, it only takes a little deviation over a long period of time to take a software team far from its original goal without someone (and preferably the team) stepping back and reflecting upon each significant league in the journey. An hour now with the team assuring that you are on track is better than an iteration making up lost ground. Performing reflective exercises more regularly will also improve the quality of the feedback as the team works out what sort of feedback is actually important.

A Closed OpenOffice

Don’t get me wrong. I like the concept of OpenOffice, but just like many other open source projects (not all of them mind you), someone could teach these people about actually meeting user’s needs (and not some idealistic view of simply creating an “open standard”).

Today I had to open a SXW file (an OpenOffice Text Document) on a windows box today and found that nothing currently installed could open it. I didn’t really care too much for the formatting, but I desperately needed the content and opening it up in a notepad-like utility proved fruitless. I was thus forced to download the only “open” office that I could actually view this with (at least that I know of, I could be wrong).

Much to my dismay (not to mention distaste) I was forced to download a whopping 64MB file just to be able to view a 20KB file. I was lucky that I had access to broadband as it would have been super painful over dial-up (oh, yes people still use this!). As a user whose goal was to simply view the raw text in a document, I would have liked to either:

  • Open up the document, ignore what special markup the formatting was in and be able to extract the raw data; or
  • Be able to download the only application that I needed to view the file with.

Useful Oracle Views

Since we finished with our migration to the Oracle 10g database, I have been meaning to post some useful notes about developing in this new environment. This last two weeks, I have found myself using Oracle’s V$ views a fair amount so I thought it might be good to share (or at least archive this information for myself).

What are V$ views?
V$ views are defined by Oracle as dynamic performance related views because they are continually updated to reflect the database state as it is running, and most of the information is pertinent to performance tuning and useful for performance monitoring. You can find more information about V$ views quite easily, both through the Oracle Technology Network or the great AskTom website.

Why should I bother to use V$ views?
Many GUI interfaces are widely available to help administer and monitor Oracle databases and sometimes you may never have a need to use these views. However sometimes those tools are beyond the reach of your normal developer and interfacing with Oracle at this lower level can be the simplest solution for what you need. A database configuration where people who can execute any arbitrary SQL statement should also generally grant them with the access to read from these very informative views.

What are some useful examples for making the most of these views?
Easily monitor through the number of connections with:

SELECT SID, SERIAL#, PADDR, USERNAME, STATUS, MACHINE
FROM V$SESSION

Monitoring the total number of connections as your application is running may give you a good example of how well your application is properly managing its connections. Those connections that sit there in an INACTIVE state are probably ideal candidates for further investigation. If you have the DBA role, you can then kill sessions (with care) with:

alter system kill session 'sid,serial#';

Uncover the SQL statements that are currently running with:

SELECT text.SQL_TEXT
FROM V$SESSION session, V$SQLAREA text
WHERE session.sql_id = text.sql_id

Another view exposes settings for National Language Support (NLS) parameters. We once had issues with database instance managements that resulted in us creating a set of environmental acceptance tests as a cheap way of detecting differences in database configurations. These were useful for ensuring settings such as the NLS_DATE_FORMAT were configured correctly for standard JDBC.

SELECT *
FROM V$NLS_PARAMETERS

A Hole In The Loop

I have been part of a production support team lately and an issue that was raised this week had me concerned about some of the state we seemed to be operating in. We had a situation where a business analyst who wrote the requirements for a particular part of the system had to keep coming back to development asking how that was part of the system was supposed to be working.

I must apologise, but I thought our current process was actually working to ensure that the development loop was tight. Testers would work with BAs to ensure that all the scenarios were covered, developers would write to meet those scenarios and the BA would walkthrough the application to ensure that all of their requirements were met before signoff (completion of the storycards). It could have just been an off-day, but it worries me when business people come to the development team to see what the business rules should be.