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

OO-UML

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi!
why UML people needs both class diagram and object diagram?
and both collaboration diagram and sequence diagram?
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by veeransenthil kumar:
hi!
why UML people needs both class diagram and object diagram?
and both collaboration diagram and sequence diagram?


A class diagram represents a static view to the design, while an object diagram visualizes the runtime interaction between objects. "Object != Class"...
The difference between a collaboration diagram and a sequence diagram is similar. They both communicate the same information but from a different view. A sequence diagram is good for visualizing the time-ordering of messages while the collaboration diagram is good at visualizing relationships between objects.
 
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 veeransenthil kumar:
why UML people needs both class diagram and object diagram?


Because they show different information.
From a class diagram, you can't see how many objects of class will exist in the system at a specific point. The only thing you see the *potential* for existing objects and links between them. For example, class A has an association to B with a "*" multiplicity. How many instances of B will exist after you started the system? You simply can't tell.
An object diagram, on the other hand, does show a "snapshot" of the existing objects at a specific moment. Say you have an object a with links to objects b1 to b3. Can the number of b's change later? You can't tell from the object diagram.
Typically, there is an infinite number of possible object diagrams to a class diagram.
Does that compute?
 
Cob is sand, clay and sometimes straw. This tiny ad is made of cob:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic