English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

3 answers

It's not. That's a bunch of hooey balooey that people make up to try and make like they're smart. There's not single right way to do anything in programming.

If this is for a test, just regurgitate whatever the teacher said and then forget it as quickly as possible (or after the comprehensive final - whichever is later)

2006-09-19 17:11:29 · answer #1 · answered by xaxxon44 2 · 0 0

In UML, the class diagram is the boss. All of the other diagram types (with the exception of the deployment diagram and use case diagram) are dependent upon it, since they refer to objects, which in turn are instances of classes. The class diagram is also the only diagram that interfaces with the actual program code, either for generating code or for reverse-engineering existing code.

To answer your question specifically, you should draw the class diagram before the sequence diagram so that when you are detailing the interaction between objects you know which objects to use. The class diagram provides the "raw ingredients" for starting your sequence diagram.

As others have noted, this is not a strict requirement like a law of physics or anything. In reality, you can start with any diagram you want, but you will have to think about what objects to include in your diagram. If you are thinking about them anyway, you might as well jot them down in a class diagram to hold your thoughts. The whole process of modeling in UML is very iterative, as changes in one diagram need to be propagated to the others. You might start with some basic ideas of which objects to use, so you put these in a simple class diagram, but as you start filling in the details in a sequence diagram, for example, you might notice that you need another intermediate object which would have to be added to your class diagram. Details like messages between objects are translated into methods, which also get added to the class diagram.

As an aside, all of these little changes that have to be propagated between diagrams can add up to a significant amount of work. It is a good idea to use a software tool to help keep it all straight and to automate as much as possible. There are some very good free and open source tools, such as ArgoUML. I personally use the community edition of Poseidon UML, which is based on ArgoUML. It is pretty solid, and it is free (but not open source).

See the resources below for links to these tools.

I hope that this helps!

2006-09-20 13:25:53 · answer #2 · answered by codewriterdavid 3 · 0 0

First things first - when drawing sequence diagram, you should already know your classes and relationships between them.

If you don't, then, as the sequence diagram will grow, you will have to improvise and make decisions about your classes. And without class diagram already drawn, these decisions may be contradictory.

In real life you may need to go back and forth between both diagrams, making corrections.

2006-09-20 02:23:52 · answer #3 · answered by alex_self 2 · 0 0

fedest.com, questions and answers