Communication Diagrams / Sequence vs Communication Diagrams
Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.
Learn More
Subtitles of the Movie
As you know sequence diagrams and communication diagrams are both kinds of interaction diagrams. These diagrams show the objects in a system and the messages that pass among those objects or those participants. These diagrams are semantically equivalent and many UML tools can convert between them. So which kind of interaction diagram should you use? Some UML gurus will tell you that you need both even though these diagrams show much the same information they emphasize different things. Others will say to use sequence diagrams and forget about communication diagrams or more rarely vice versa. Each type of interaction diagram has its strengths and weaknesses and that's what this movie is about. Now as you can see on the screen here the sequence diagram on the top and the communication diagram on the bottom both give pretty much the same information. They identify various objects, and the messages that are passing among those objects. The sequence diagram at the top emphasizes the sequence or the ordering of the messages where as the communication diagram below emphasizes the objects and the links among those objects. In deciding which one to use in your own project you should consider the strengths and weaknesses of both. So let's go over those starting with the sequence diagram. Now of these two sequence diagrams are far more common and they do have quite a few benefits. Sequence diagrams are easy to read and to understand and a lot of people who are not terribly skilled at reading diagrams can look at the sequence diagram and really get the gist of what its trying to convey. Sequence diagrams emphasize the ordering of messages over time because of the way their drawn with time on the vertical axis and reading the diagram from left to right. Sequence diagrams are helpful for showing the interactions of numerous objects within a single use case. And it's worth mentioning that these diagrams support asynchronous messages. Sequence diagrams can reveal potential bottlenecks in your design because you get an idea of what messages are being sent to an object when their being sent, in what order, how many are being sent and also an approximation of how long it takes to run each method that's invoked, looking at this can help you identify a potential trouble spots for messages to pile up and things to slow down. Of the two sequence diagrams are better to find in the UML specification then communication diagrams are. However sequence diagrams because of the way they are drawn can get unwieldy, they can become very wide from left to right whenever you add a new object, you add it to the right and this can make them very big and very unwieldy. And similarly they can be tricky to edit and revise, particularly if you're drawing your diagrams on a whiteboard getting input from a number of people it can be tricky to add a new object that comes earlier in the sequence and then revise from there. So sequence diagrams in that context can be a little bit difficult to change as your generating the diagram. Communication diagrams also have a number of strengths and weaknesses, these diagrams emphasis the objects that interact. They're an extension of object diagrams, the object diagram shows essentially a snapshot of objects in a system at a particular moment in time where as the communication diagram takes that snapshot and puts it in motion, adding the element of time and sort of stretching it out so that it's not just one particular instance. So they can be a very useful extension to object diagrams. Communication diagrams emphasis the links between objects and what that means is that they emphasis the different responsibilities that a particular object has. So if that's the sort of thing that you want your diagram to show you should definitely use a communication diagram to show it. Communication diagrams help you assign functionality to classes, because these diagrams explore the ways in which objects behave in a system. These diagrams are easy to edit, if you're adding a new object you can basically put it anywhere in the diagram and then link it to other objects that are already there. You don't have to add each new object to the right. And for the same reason communication diagrams if you're drawing them on a whiteboard may take up less room then sequence diagrams because in sequence diagrams the vertical axis is assigned time, it's not in a communication diagram so you can put objects above and below each other without saying anything about time. And communication diagrams are not fully supported by some UML tools which can make them frustrating to try to work with. So if the UML tool that you or your organization uses doesn't fully support communication diagrams it makes sense to use the sequence diagram instead. So in asking yourself which should I use keep these things in mind. Consider what do you want to emphasis? Do you want your diagram to emphasis the ordering of messages, if so use the sequence diagram or do you want to emphasis links among objects? For that use a communication diagram. Consider your organization; is there an organizational preference for one of these diagrams over the other? Is there an organizational preference for using both? Consider who will view the diagram, whose the audience that you're trying to convey information to. Sequence diagrams are somewhat easier to read then communication diagrams so if your audience consists of a wide variety of stake holders who will all be coming at your diagram from very different perspectives the sequence diagram might be easier for everyone to understand. And finally consider time and budget constraints, it's great to use both of these kinds of diagrams but if your on a tight schedule you may not have time. So if you can't use both use this checklist to decide which one is best for your particular project.
Tutorial Information
| Course: | UML |
| Author: | Nancy Conner |
| SKU: | 33815 |
| ISBN: | 1-934743-23-2 |
| Release Date: | 2007-10-26 |
| Duration: | 7 hrs / 95 lessons |
| Captions: | For Online University members only |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 98,729 Video Tutorials (23,265 free)
- Video Available as Flash or QuickTime
- Over 1026 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 