This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Class or interaction

 
Ranch Hand
Posts: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Does the class diagram come first or the sequence?
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In which context???
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I will suppress my every urge. But not this shameless plug:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic