Feeds

In the beginning, there was the flowchart...

Software diagramming - a warning from history

  • alert
  • submit to reddit

Beginner's guide to SSL certificates

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...

Providing a secure and efficient Helpdesk

Next page: OMG it's UML

More from The Register

next story
Microsoft on the Threshold of a new name for Windows next week
Rebranded OS reportedly set to be flung open by Redmond
Business is back, baby! Hasta la VISTA, Win 8... Oh, yeah, Windows 9
Forget touchscreen millennials, Microsoft goes for mouse crowd
SMASH the Bash bug! Apple and Red Hat scramble for patch batches
'Applying multiple security updates is extremely difficult'
Apple: SO sorry for the iOS 8.0.1 UPDATE BUNGLE HORROR
Apple kills 'upgrade'. Hey, Microsoft. You sure you want to be like these guys?
ARM gives Internet of Things a piece of its mind – the Cortex-M7
32-bit core packs some DSP for VIP IoT CPU LOL
Lotus Notes inventor Ozzie invents app to talk to people on your phone
Imagine that. Startup floats with voice collab app for Win iPhone
prev story

Whitepapers

A strategic approach to identity relationship management
ForgeRock commissioned Forrester to evaluate companies’ IAM practices and requirements when it comes to customer-facing scenarios versus employee-facing ones.
Storage capacity and performance optimization at Mizuno USA
Mizuno USA turn to Tegile storage technology to solve both their SAN and backup issues.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?
Beginner's guide to SSL certificates
De-mystify the technology involved and give you the information you need to make the best decision when considering your online security options.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.