• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Class diagrams from Sequence diagrams

 
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can we draw Class diagrams from Sequence diagrams? I was asked this in an Interview.

Thanks.
 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What was your answer to this question?
 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

James Clark wrote:What was your answer to this question?



I said No. They did not not say anything. I asked my friends and they say we can not too. Was I correct?

 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A Sequence diagram contains method names and class names of a group of objects that communicate with each other.

You could certainly create a Class diagram with this information. The diagram would show the class names and method names (data from the Sequence diagram.)

This might not be a totally complete Class diagram with every field, every class and relationship covered. It still would be a Class diagram, however.

So, you could create a Class diagram with data from a Sequence diagram.

If I asked this question, I would have considered "YES" to be the correct answer.
 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the sequence diagrams were comprehensive enough, the design was based on well-known design patterns and the name of the classes were descriptive enough, you could guess what the class diagram would be, but you may not get 100% accurate

It's just like trying to figure out what the parts of a clock are by watching it work. It's classic reverse engineering. You look at the behavior and try to design the thing yourself. You can get a good working model, but your model may not reflect reality 100%
 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for replying guys.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic