Architect Using Diagrams
If you can't describe a system with simple diagrams the system is flawed. I've seen diagrams for cars, military vehicles, computer chips, and other very complex systems. Block and flow diagrams that simplify and explain in just the right amount of detail. Yet, when it comes to software applications, even complex ones, I am finding diagrams difficult to find. To make matters worse, when some systems that were architected in code do have diagrams put to them you find the picture is not so pretty.

One of the best techniques I've learned for architecting a system is to start with diagrams.
Start Simple
Diagrams don't need to happen in any special way. Creating block and flow diagrams doesn't mean you need to go out and learn UML (thought you are welcome to if you like). The most basic way of doing them happens to be my favorite. Just break out a pencil and some paper.
If you do design on paper and have to share with others who can't just read your paper notes is when a program needs to come into play. And, there are a lot of programs available to generate diagrams with.
Two Types To Start With
There are two essential types of diagrams to architect or describe a system.
- Block Diagram - Basically, describing the different subsystems, components, objects, or modules and how they interface or interact with each other. What goes in, what comes out, and how they all connect together.
- Flow Chart - How do users or data flow throw the system? What happens at decision points? The flow from one end of the application to the other. Or, from one point to another.
Benefits
Coding is fun. Developers and programmers tend to gravitate towards writing code. Architecture and documentation in general is never quite as exciting. That's one of the reasons so many open source projects suffer from documentation voids. It's just not as much fun.
There are some real benefits we can all get from diagrams.
- Finding those WTF moments in the flow before you code your way into that corner. (this is one of my favorites). This saves time, money, and frustration.
- Makes it easier to explain. Explaining things is often not easy. Especially when people are located all over the word (as with open source projects) or you are trying to explain something to a client, manager, or user experience expert. Diagrams provide an easy way to break things down to explain.
- Breaks projects up into build-able chunks. Creating and estimating tasks lists is not an easy task. Diagrams help break up something large into something smaller and more accessible. That in turn makes describing and estimating tasks easier. Diagrams can describe dependencies which help with the ordering of tasks and figuring out what is optional or required.
- Building for reusability. When you visually see the different components and how they interact with each other it's easier to group reusable parts. Reusable parts mean less code, less debugging, and more building on what works.
Now is the perfect time to start talking about Architecture. As code is transitioned to PHP 5.3, as work on Drupal 8 begins, and as modules start porting to Drupal 7 we can begin to make things cleaner and easier for people to understand.

A tool I use when I'm building a new Drupal site is Freemind - on open source mind-mapping application. You can find it here:
http://freemind.sourceforge.net/wiki/index.php/Main_Page
+1 for Freemind
Mind mapping is a little different that creating flow diagrams and block diagrams. With it is nice, it doesn't do quite what those others do.
+1 for Freemind, for the structure and CCKs rather than for the business logic
Heh. I've often found that I'm only able to diagram the complicated systems I've written after I have a simple prototype. Actually, often i find digrams useful at that point. If it can't be described by a flow chart then there's probably something irrational going on and the prototype stage is a great time to deal with that...
Generally, I only use flow charts - but that's just me.
For me it depends. When I am site building flow diagrams are sometimes useful. When I am building simple modules it doesn't make much of a difference. But, when I am coding complex modules that interact together and are thousands of lines of cod, using block and flow diagrams help.
When it comes to more complex systems, like Drupal core, it can really help to see how some of the larger changes impact the surrounding system. Or, seeing how the flow actually works (e.g., see the data flow for saving a node and the difference between node_save and drupal_execute).
But, when I am building (configuring modules) client sites the diagrams are not so helpful.