The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
I often find myself switching between class and sequence diagrams during initial design. First I try to gather the most important classes on the paper, then validate the class diagram by drawing the most important interactions into sequence diagrams, enrichen the class diagram, draw some more sequence diagrams, etc. So, based on this I'd say class diagram comes first but neither one is "finished" first.
I agree that in that case they should be done concurrently - if at all. You should also think about alternatives. If I remember correctly, Robert C. Martin suggests using collaboration diagrams instead of sequence diagrams - because the dynamic structure is much more important than the sequence of messages in most cases. Another technique to consider are CRC cards - they allow for a much more dynamic exploration of possibilities than diagrams. And when doing test driven development, I find that most often I don't see value in interaction diagrams. A roughly sketched class diagram suffices, if I need it at all.
After the Use Case is modelled, it is matter of choice to use Class Diag. OR Seq Diag. Depending upon the application analysis you may like to consider first sequence diag. and then may be class diag. OR both can be designed concurrently. The goal is to capture the behaviors yup - Raj
- Raj<br />[MCSE, SCJP, SCWCD]
Joined: Jul 11, 2001
Originally posted by Raj Waters: The goal is to capture the behaviors
I have that chart by Scott Ambler on my wall just to shock people who are walking by. Everybody here made good points - use whatever model works, use a bunch at once, use neither. My own style is to use collaboration earlier and sequence later. They are two views into exactly the same underlying model and Rose can even transform either one into the other. Collaboration tends to expose more structure and sequence more logic.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi