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?
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