The Importance of Using the Unified Modeling Language (UML)

by John Zukowski

Last month, you learned about creating a set of use cases to help you in the development of a Todo List Manager application. There is more to use cases than identifying them with names such as Create Task and Generate Report. They are meant to specify a sequence of actions for the system to perform, as observed by an actor or user.

Once you have the high-level tasks defined in use cases, you can document the use case further by describing specific paths through the system. For instance, the Edit Task use case can have a sequence of actions through the use case as follows:

  • System presents list of tasks to user.
  • User identifies which task to edit.
  • User makes changes to task.
  • System updates record for task.

Going to this level of detail might seem overkill for such a small task, but as you understand the process, it makes larger projects that much easier to develop. It also allows someone to hand off the subparts of the use case to different team members, allowing well-understood work to be done in parallel. In addition, breaking the use cases down allows you to attach quantifiable measures if the tasks have requirements for things such as response time. Had this Todo List manager application been required to run on a telephone, how would the Edit Task action react when a phone call comes in?

Additionally, when defining use cases, it is best to identify test cases as well. For a single user Todo List application, the Edit Task use case is relatively easy. But when you have a multiuser environment, the use case can have a test case for handling multiple users.

If you define the appropriate response up front, before development has started, coding becomes that much easier because you already know how the system should respond to dual updates.

Part of the documenting of use cases and of a whole system's design is the creation of different diagrams. Last month, you saw the aptly named use-case diagram. This is a rather crude-looking diagram in which the actor is literally a stick figure. As you start to learn about other diagrams, a tool can be helpful. Two popularly available open-source options are the NetBeans 5.5 IDE UML Modeling pack plug-in and ArgoUML available through CollabNet.

These tools use Unified Modeling Language (UML) to document a system's model. The Object Management Group (OMG) standard offers a common method for system modeling. The process began a little over 10 years ago when "the Three Amigos" -- Grady Booch, Ivar Jacobson, and James Rumbaugh -- came together to adopt a common syntax that wasn't proprietary to help speed the adoption of object-oriented technologies. At the time, Linux was about five years old, and the open-source movement and all its associated sharing were not yet popular.

Although the latest UML release, 2.0, defines 13 types of diagrams, most tools don't support them all. The NetBeans IDE UML Modeling tool allows you to create eight diagrams: Use Case diagram, Activity diagram, Class diagram, Collaboration diagram, Component diagram, Deployment diagram, Sequence diagram, and State diagram. ArgoUML doesn't provide support for the Component diagram, but it does support the other seven. One nice feature that both tools offer is a reverse-engineering feature, allowing you to generate the UML model and diagrams straight from the source code. This feature can be useful in many different ways.

If you're new to an existing project and you understand the UML diagrams, this allows you to learn the system design quite easily. If you're lazy and didn't document your project, you can generate quite a bit of documentation for your boss when she asks for all that documentation you promised.

A third option helps you understand how to create UML diagrams themselves. If you're constantly using the same pattern in your development and not sure how to document it in UML, code it and then see how the tool does it. In fact, the NetBeans IDE UML tool includes a whole set of predefined patterns, including those from the Gang of Four and many EJB technology-related tasks.

As you learn more about system design and development, be sure to pick up one of these tools to help you along the way. You won't be disappointed.

Once you've picked one, try to create a sequence diagram for the Edit Task operation previously described. You will soon see why it is best to use a tool for just such a task.

Comments:

Thanks for that post. It made me use netbeans the first time. Though I did not manage to get from it what I wanted (All classes, just their names, in a dependency diagram, automatically) it made me aware of flaws in my project structure and build.xml. Eclipse is much to forgiving there :)

Posted by stammi on June 15, 2007 at 07:55 PM PDT #

We just published an Intro to UML on www.netbeans.org which might be interesting as well. It includes a list of diagram types and pointers to tutorials for each type. Check it out! <http://www.netbeans.org/kb/55/uml-why-model.html>

Posted by Tori on June 21, 2007 at 05:39 AM PDT #

Thank you. That was good reading.

Posted by stammi on June 21, 2007 at 06:56 AM PDT #

i wanna somalinet

Posted by liibaan xirsi on June 21, 2007 at 12:05 PM PDT #

This is a sort of post that covers the basic fundamentals and why modeling is important. Thanks. Can you pls. provide the link where you have covered the one for usecases for the "todo list manager". I couldn't find it after many searches too.

Posted by Mohan on June 21, 2007 at 12:30 PM PDT #

hola :0

Posted by guest on June 21, 2007 at 04:05 PM PDT #

Hey, this post conceptual is very good. Give a view around all diagram in usage in UML thx

Posted by Fred on June 21, 2007 at 09:36 PM PDT #

hi

Posted by upender kataria on June 22, 2007 at 05:24 PM PDT #

I like this site very much

Posted by werty on June 22, 2007 at 05:32 PM PDT #

<h1> <marquee>hello</marquee> this information is helpful thanx </h1>

Posted by Hasan on June 24, 2007 at 07:04 AM PDT #

good

Posted by guest on June 24, 2007 at 12:03 PM PDT #

<html> <body> <marquee> Hai sir, This is Vasim Ahmed from Measi Institute of info Tech chennai. I am Studying Final Year MCA .So Please Give Me Some Idea to Do Project In j2ee.pleasure with Thanks.

Posted by vasim on June 24, 2007 at 03:37 PM PDT #

Very useful article! Welcome to <a href = "http://mixa1984.narod.ru">Mixa-Portal!

Posted by Mikamj on June 25, 2007 at 06:04 PM PDT #

Everyone else in the family can get MSN game, Text Twist, but evereytime I try, I get cannot load because of Jave TM environment. Whatever does this mean and what do I do?

Posted by Carol J Griffis on June 26, 2007 at 07:16 AM PDT #

Hi Vasim "Hai sir, This is Vasim Ahmed from Measi Institute of info Tech chennai. I am Studying Final Year MCA .So Please Give Me Some Idea to Do Project In j2ee.pleasure with Thanks" what sort of project u r looking in j2ee? probably your are looking for some sort of homework. If you had known the project you wouldn't be asking for it. You should create the project from your ideas if u have any!!

Posted by gh on June 26, 2007 at 02:30 PM PDT #

extremely good!

Posted by guest on June 26, 2007 at 03:51 PM PDT #

hi, everyone

Posted by him on June 26, 2007 at 05:18 PM PDT #

I would like to know why the sun recomends so strongly the use of NetBeans! I like NetBeans, but I think that would be better if the NetBeans was ideologically independent like Eclipse.

Posted by Thiago Brito on June 27, 2007 at 03:01 AM PDT #

It's nice to see netbeam UML tools, I looking forward from it.

Posted by sagar on June 28, 2007 at 04:28 PM PDT #

hey it's nice as i know UML is must in java software developing. It is good option that java support to developers by using Netbean UML tools.I want to see that tools.

Posted by sagar on June 28, 2007 at 04:31 PM PDT #

lol, comment spammers are lame and make huge fools of themselves. I don't know whether or not if it is the right decision for me to start using Netbeans, but probably I should. I am very skeptical to such graphic tools that do coding as I feel I lose control over just what I do.

Posted by Quakeulf on June 28, 2007 at 06:14 PM PDT #

Can you tell me how to chick to see if Microsoft Java Virtual Machine is working on my computer. Thank you, James Wm. Chance 885 E. Broadway St. Fortville, In. 46040-1117 317 485 7381

Posted by James Wm. Chance on June 29, 2007 at 07:44 PM PDT #

This site inspired me 'bout knowledge is free and we can learn in many ways...thanx so much Sun.....you are so great...

Posted by Sapardi on July 03, 2007 at 11:53 AM PDT #

The Netbeans link mentionned in the second comment provides very valuable information. You could also find free information on UML modelling in the UML section of the Software Development Article Directory (http://www.softdevarticles.com/modules/weblinks/viewcat.php?cid=39) and the archive section of the Methods & Tools newsletter (http://www.methodsandtools.com/archive/archive.php)

Posted by Franck on July 26, 2007 at 03:01 PM PDT #

I missed the previous discussion for the author's example, is there a link where i can find it and play with it in netbeans?

Posted by joao coelho on August 31, 2007 at 01:58 AM PDT #

I think the use of UML should be restricted based on the assignment/project/problem in hand. For smaller projects or easier problem, which does not need collaboration between various classes, one could skip UML.

Posted by aj on September 04, 2007 at 05:04 PM PDT #

The title of the article -- "The Importance of Using UML" -- is absolutely something I am interested in.

The trouble is that this particular article has literally one sentence covering WHY you would actually use UML. "It makes larger projects that much easier to develop" So, should I never use it for small or medium sized projects?

I don't need the history lesson (3 amigos), or even a listing of several tools (netbeans, argoUML). Just tell me why I should care about using UML in the first place. Or correct the article title.

Posted by bgsu_drew on October 06, 2007 at 01:31 AM PDT #

Note: this is my second attempt at posting this comment. I assume the first didn't make it to this page because of an oversight by the moderator. With insightful comments such as "extremely good!" listed above, I can't imagine how anything would be rejected.

The title of the article -- "The Importance of Using UML" -- is absolutely something I am interested in.

The trouble is that this particular article has literally one sentence covering WHY you would actually use UML. "It makes larger projects that much easier to develop" So, should I never use it for small or medium sized projects?

I don't need the history lesson (3 amigos), or even a listing of several tools (netbeans, argoUML). Just tell me why I should care about using UML in the first place. Or correct the article title... something with the word "Overview" would be more appropriate.

Posted by bgsu_drew on October 10, 2007 at 05:13 AM PDT #

hello
i want
1 Give three reasons for using UML?
2 List five reasons for using Use Case?
3 Explain when to use include, extend, and generalization of Use Case?
4

Posted by samer on December 13, 2007 at 07:35 PM PST #

Basically , UML is used to model a system.Using uml diagram we can understand system behaviour, external interfaces of the system

Posted by Manoj on May 01, 2008 at 05:31 PM PDT #

My favourite topic! Check out my blog http://advanceduml.wordpress.com for real-world examples of UML and my take on UML usage.

Posted by S. Kishore Kumar on September 21, 2008 at 08:49 PM PDT #

Post a Comment:
Comments are closed for this entry.
About

Java Technology Fundamentals are now covered as part of the Core Java Technology Tech Tips. Please go there for more tech tips.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today