HomePractices Page 7 - Introducing UML: Object-Oriented Analysis and Design
Itís All About Communication - Practices
The purpose of UML, or Unified Modeling Language, is communication; to be specific, it is to provide a comprehensive notation for communicating the requirements, architecture, implementation, deployment, and states of a system. This article will offer an overview of Object Oriented Analysis and Design, focusing in on the three most important concepts it encompasses: objects, analysis, and design. It is excerpted from the book UML Applied: A .Net Perspective, by Martin Shoemaker (Apress, 2004; ISBN: 1590590872).
I hope that the exercises in this chapter have eliminated any mystique about UML in your mind; but even more, I hope that I have set an example of how UML can be used to communicate ideas. The underlying point for this section and the whole book is this: UML is about communication.
Donít worry about being perfect all at once (or ever!). If youíre communicating, youíre using UML effectively. Thereís always room for improvement; but donít let imperfection stop you from progress. Thatís a key point in learning and applying UML and in applying UML as part of a process. Your designs wonít be perfect; but as your team reviews them and you refine them, they will become good enough: good enough to build the system, good enough to guide the testing and the documentation, good enough to drive the management of the process. A team that waits for perfection is just as bad as a team that is wedded to code-and-fix: neither team produces an effective design that leads to a successful system. Remember: code-and-fix bad; design-and-fix good.
Letting Go of Perfection: A Lesson from the Graphic Arts
If I havenít persuaded you yet to let go of perfection, it wonít surprise me. Itís easy for me to say that you can make imperfect diagrams and improve them later; but how do you do it? How do you just sit down and start drawing diagrams when thereís nothing you know? I hear this most often from students who are drawing Sequence or Activity Diagrams: ďHow can I draw this diagram until I know which objects are in the system?Ē And they have it exactly backwards: theyíll use the diagrams to discover objects that solve the problem. But they want to draw the right picture. Maybe theyíre afraid to look foolish in reviews. (Reviews can be intimidating even to a strong ego like mine!) Maybe theyíre just hypersensitive to the risks in the wrong design. Maybe they have embraced the idea that the design is supposed to help them get things right, and therefore are reluctant to risk getting things wrong. But whatever the reason, they just canít seem to let go.
So I try a different approach. My students who have seen me sketch diagrams at the flip chart are very aware that one thing Iím not is an artist. But borrowing a technique from the graphic arts,12 I draw the images shown in Figure 1-10, one on top of another.
Figure 1-10.Refining from imperfect to communication
The technique is simple: put down some detailóeven if itís wrong, such as the sizing circles in the first image óto serve as a basis for further development; then add and erase detail as needed to refine the picture. Iím still not an artist (I draw fencers because the hard parts are hidden behind a mask and a weapon); but by applying some simple techniques and refining, I end up with a much more recognizable picture than I would have if I sat down and tried to draw a perfect fencer from scratch. Imperfection and refinement produces better (and faster!) results than does a foolish insistence on perfection.
Scott Adams tells us, ďCreativity is allowing yourself to make mistakes. Art is knowing which ones to keep.Ē13 Take this attitude to heart in your analysis and design process.