Feeds

In the beginning, there was the flowchart...

Software diagramming - a warning from history

  • alert
  • submit to reddit

Secure remote control for conventional and virtual desktops

State of the art

From the foregoing, you may have formed the impression that I am against all diagrams. Not so. The moment is overdue for a mention for the queen of all software diagrams: the state transition.

Out of all the techniques I have described, only the state transition diagram really delivers. It alone can show compressed ideas that would otherwise be hard to express, and it is one of the few diagrams one can draw to design the program, rather than put together retrospectively to document a design one has conceived in another form.

Enough abstract discussion. As a concrete example, here is a state transition diagram I drew a few years ago, portraying the automatic call handling system of a customer care centre:

A large state transition diagram, implying that customer care centres never pick up the phone

I feel sure you agree that this diagram is a paragon of terse clarity.

In fact, equipped with the above, one has all the information needed to design the system's classes. An excellent opportunity to segue into another kind of diagram: the UML class diagram. To keep up the standards of good practice you expect from me, I will (of course) use the Gang of Four's famous State pattern to create my design. Here we go:

An animation of a UML diagram, suggesting that the classes are drawn too close together and are wriggling for more room

Those of you who are watching carefully will notice a slight drop in clarity of intention and available information between the state transition diagram and the class diagram derived from it.

To be fair - and with considerable reluctance - I admit that this is not really the fault of the UMLerites. It is an unhappy consequence of the way the State pattern works that the underlying design is buried in a blizzard of silly little classes. This difficulty is reflected in the production code.

Public Service Announcement: fellow programmers who experience this genuine problem in real life, and who code in C, C++, C#, Java or one of seven other languages, should urgently haul their sorry browsers down to smc.sourceforge.net and pull down a copy of Charles Rapp's splendid State Machine Compiler. This elegant utility, easily bodged into the build, allows you to work directly from your state transition design, without bothering your pretty head with the implementation of the State pattern. Once you have tried it, I promise you will never hand-code State again.

Now let us continue, while we bring the flowchart into the modern era...

The essential guide to IT transformation

Next page: OMG it's UML

More from The Register

next story
Apple promises to lift Curse of the Drained iPhone 5 Battery
Have you tried turning it off and...? Never mind, here's a replacement
Mozilla's 'Tiles' ads debut in new Firefox nightlies
You can try turning them off and on again
Linux turns 23 and Linus Torvalds celebrates as only he can
No, not with swearing, but by controlling the release cycle
Scratched PC-dispatch patch patched, hatched in batch rematch
Windows security update fixed after triggering blue screens (and screams) of death
This is how I set about making a fortune with my own startup
Would you leave your well-paid job to chase your dream?
prev story

Whitepapers

Endpoint data privacy in the cloud is easier than you think
Innovations in encryption and storage resolve issues of data privacy and key requirements for companies to look for in a solution.
Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Advanced data protection for your virtualized environments
Find a natural fit for optimizing protection for the often resource-constrained data protection process found in virtual environments.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.
Next gen security for virtualised datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.