How to avoid the model quagmire

Part one: Analysis paralysis

HP ProLiant Gen8: Integrated lifecycle automation

One of the goals behind UML is to help stamp out ambiguity in specifications and designs. This is a good and noble goal, but UML is nobbled by its own nobility.

Booch, Rumbaugh and Jacobson, who donned matching aprons and cooked up UML, baked in some pretty subtle constructs to distinguish between even subtler concepts that - in theory - let you produce precise, unambiguous models. As you'd imagine, this has led to some fraught debates over the interpretation of these subtle modeling elements.

Last time, I delved into the equally fraught debate on whether program methods should have single or multiple return points, and - as many readers correctly noted - the answer is: "Who cares? Clearer code and getting the job done are much more important."

And so it is with UML. All too often I've seen analysts and developers get bogged down in unnecessary details: an ailment generally known as analysis paralysis. This is not to disparage UML itself: it's perfectly fine for the job at hand. But whatever you're using it for, it's a means to an end, not the end goal.

What follows are some answers to the more common questions that bog people down, offered in the hope these will save you from some serious hours stapled to a whiteboard in the company meeting room.

Q: These use cases seem related - we should connect them. Shall we use <<includes>> or <<extends>> stereotypes?
A: Don't worry about it. These are use cases, not code.

Q: These domain classes are related - we should join them up. Shall it be an aggregation, composition or association type of pointy line?
A: Except in the most rare of cases, it doesn't matter. It probably won't affect the code. To illustrate, here's an aggregation relationship in Java:

private Planet myPlanet;

And here's an association in Java:

private Planet myPlanet;

Spot the difference?

Composition is a bit trickier, as the container class is responsible for the contained class's lifecycle. Simplifying things a bit, it'll look something like this:

private Planet myPlanet = new GasGiant("Jupiter");

But if you're looking at a domain model and not the detailed design, it definitely doesn't matter. The type of relationship is only relevant much later on, and by then the one to choose should be obvious.

Q: Which direction should the arrows go in on my robustness diagram?
A: Again, don't worry about it. Showing the direction isn't the purpose of the diagram. Just draw lines without arrowheads, you'll save time and not lose any relevant detail.

Q: How do I get my diagramming tool to split up the "focus of control" rectangles on my sequence diagram?
A: Guess what? Don't worry about it. Sequence diagrams were originally intended as a tool for allocating behavior among collaborating objects, and it's what they're best used for. So being able to visualize the start and end of individual methods is less important than identifying the methods in the first place. Plus, messing about with those little rectangles can get really fiddly. It's better just to switch them off altogether.

That's all fine as far as it goes, but how do you know when a particular nuance is inconsequential and when it's an important item to specify? That's for next time, when I'll describe some handy ways of spotting the subtle, and not-so-subtle, symptoms of analysis paralysis on your project.®

Matt Stephens has co-authored Use Case Driven Object Modeling with UML: Theory and Practice, which illustrates how to step nimbly from use cases to code while avoiding the dreaded analysis paralysis.

The Power of One eBook: Top reasons to choose HP BladeSystem

More from The Register

next story
HIDDEN packet sniffer spy tech in MILLIONS of iPhones, iPads – expert
Don't panic though – Apple's backdoor is not wide open to all, guru tells us
Apple fanbois SCREAM as update BRICKS their Macbook Airs
Ragegasm spills over as firmware upgrade kills machines
NO MORE ALL CAPS and other pleasures of Visual Studio 14
Unpicking a packed preview that breaks down ASP.NET
Captain Kirk sets phaser to SLAUGHTER after trying new Facebook app
William Shatner less-than-impressed by Zuck's celebrity-only app
Do YOU work at Microsoft? Um. Are you SURE about that?
Nokia and marketing types first to get the bullet, says report
Microsoft takes on Chromebook with low-cost Windows laptops
Redmond's chief salesman: We're taking 'hard' decisions
Cheer up, Nokia fans. It can start making mobes again in 18 months
The real winner of the Nokia sale is *drumroll* ... Nokia
EU dons gloves, pokes Google's deals with Android mobe makers
El Reg cops a squint at investigatory letters
prev story


Designing a Defense for Mobile Applications
Learn about the various considerations for defending mobile applications - from the application architecture itself to the myriad testing technologies.
How modern custom applications can spur business growth
Learn how to create, deploy and manage custom applications without consuming or expanding the need for scarce, expensive IT resources.
Reducing security risks from open source software
Follow a few strategies and your organization can gain the full benefits of open source and the cloud without compromising the security of your applications.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.
Consolidation: the foundation for IT and business transformation
In this whitepaper learn how effective consolidation of IT and business resources can enable multiple, meaningful business benefits.