About Us
Education and Training
Consulting
Gifts
Contact Us
Employment
Journal
Journal

Home

The Pantheon Systems Journal

Teaching UML
by Niranjan Ramakrishnan

I thought I saw a banker's clerk
Descending from a bus.
I looked again and saw it was
A hippopotamus.
If this should stay to dine, said I
There won't be much for us.

-Lewis Carroll

In this article I want to summarize our experiences in teaching UML. We have been offering UML for over a year now as part of our OOAD course; before that we had taught OMT and Fusion similarly. We have gained some valuable lessons on what people like, what they enjoy, where they have the most problems, and how to address these problems.

Our approach to all our courses is similar in one sense. We are acutely conscious that students are taking time away from their work or leisure to come to our classes. We feel responsible for making it worthwhile for the them. To this end we strive to make our offerings concise, with a hard focus on the practical. We have been gratified - our students tell us they find our courses solid, compact, and packed with practical information and hands-on experience.

Who attends?
The OOAD class gets a range of attendees - some have programmed in OO languages, others are programmers but new to OO. Some are familiar with pre-UML techniques and want to learn UML. We also get managers who don't program, but want to know about OO analysis and design. Our task is to take students from varied backgrounds and get them thinking and formulating in objects. We are constantly aware that this cannot be done by putting them in a straightjacket - creativity cannot be made-to-order, but can we at least give them the tools to formulate problems clearly, understand why one formulation can be considered better than another? Can we get them to abstract? Can we get them to communicate their analysis? This is where UML can play a significant role.

Putting UML in perspective
UML is only a diagramming technique - a comprehensive one, perhaps, and certainly an extensible one - but still only a standard mechanism to draw pictures. It may be indispensable, but it is certainly not sufficient. An OOAD course must present a balanced view of where UML fits into the methodology, and how it can help clarify analysis and tradeoff rival models. This is a constant theme in our course.

Do code examples help?
The course is not based on any specific OO language. We state this at the outset, and also in the course outline. This is because too many courses on OOAD deteriorate into language debates - not even arguments over OO features supported by this language or that - but over language syntax and such. On occasion, students do ask how a particular UML construct - say composition or aggregation - would be achieved in a language. This must and is answered by putting up a short code fragment in the language.

Where do students stumble?
We have found that the most students falter, not in their ability to comprehend individual concepts, such as what inheritance means or what associations can represent, but in the far more basic (and essential) exercise of ignoring information. The art of simplification at the center of object orientation, and it is surprisingly hard to teach. Nature or nurture has taught people that complexity is good, and worse, that sophistication in design is revealed in its complexity - so much so that they are somewhat sheepish if they have found a simple way to represent something. Of all the battles fought in the OOAD class I think this is the most vital. Our labs illustrate how even complex problem statements can be pared down to their essentials and stated simply. Students are first surprised, then delighted.

Does a real tool help?
Yes and no. Although we do point students to several of the UML tools in the market - even some available free for evaluation, we have opted against using an automated tool in our class itself. This is because we want students to focus on UML, not on the tool. Some of our students are able to use the tool, but not as confident about their design decisions. Others are unfamiliar with both. As they stand, the tools take some learning, and this would be time taken away from learning the UML as far as this class is concerned. Our students have had no difficulty taking what they have learned in the classroom and using their tool of choice in the workplace. When we find a tool that is simple enough to use that it does not distract from the main goal, we will likely use it.

CRC or no CRC?
CRC is, strictly speaking, not part of UML. On the other hand, it is a time-tested technique for teaching OO. We use it. We also teach when to drop it. It is, as they say, like a boat - an artifice to be left behind after the crossing.

Example City
Examples are the lifeblood of any instruction. A good example is worth a thousand words (and pictures, and books). To succeed, examples must be short, succinct and focused. The student must know what is being illustrated, and the illustration must be immediately obvious. It is also necessary that the examples must be from domains everyone is familiar with. We choose simple domains - telephones, televisions, grocery stores, etc. for our domains. Students love it. We invariably get specific mention of our examples-based instruction in the course evaluations. Here are a couple of examples:

Abstract class
Can you go to a bank and open an account?
You can - but it has to be a Savings, or a Checking, or a CD, or something like that. Come to think about it, there is no such thing as an Account. It is only a convenient notion…

Synchronization in Activity diagrams
Say you are preparing breakfast. You put the water for the tea on the stove, and pop the bread into the toaster, and the milk in the microwave oven. You still need to make the tea - which you can do only after the water has boiled, and make the oatmeal, which you can do only after the milk is heated. And all the three items - tea, oatmeal and bread - need to be ready before you can serve breakfast.

Comprehensive labs or piecemeal labs?
There are two prevailing views in the training business about labs (at least among those who think labs are important). Should the labs build on each other, or should they be independent? Both points of view have strong arguments. The individual lab proponents say that this allows the student to proceed to the next lab even if the current lab is not satisfactory. This will happen, no doubt. The build-on-each-other-lab proponents say that that is the only way to simulate real life.

Our approach uses both. We build a series of small labs where the student cannot but succeed. Based on the small labs, there is a thread of larger labs which build on each other. The small lab helps the students understand a UML construct, and this equips them to apply the construct toward to a larger lab which is part of a comprehensive lab exercise. The comprehensive lab gives students a complete experience of the use of the UML in a real-life design.

 

 


Top
Journal Archives | Send Feedback


CopyrightÓ Pantheon Systems, Inc. All rights reserved.