File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Class or interaction

 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Does the class diagram come first or the sequence?
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In which context???
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Raj Waters
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Raj Waters:
The goal is to capture the behaviors

Well, the primary goal is to get enough understanding of the problem and its solution to be able to start coding the latter. Emphasis on *start*!
http://www.agilemodeling.com/essays/iterateToAnotherArtifact.htm has some very good thoughts on the subject.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic