What is the difference between a Class Diagram vs an Object Diagram?

Ahmed Mahmoud picture Ahmed Mahmoud · Oct 9, 2013 · Viewed 66.2k times · Source

What is the difference between Class Diagram and Object Diagram?

Answer

MrSimpleMind picture MrSimpleMind · Oct 9, 2013

As specified in the UML specifications:

class diagram is a graph of Classifier elements connected by their various static relationships. Note that a “class” diagram may also contain interfaces, packages, relationships, and even instances, such as objects and links. Perhaps a better name would be “static structural diagram”, but “class diagram” is shorter and well established.

object diagram

is a graph of instances, including objects and data values. A static object diagram is an instance of a class diagram; it shows a snapshot of the detailed state of a system at a point in time. The use of object diagrams is fairly limited, mainly to show examples of data structures.


In simple words...

Class diagram shows a collection of declarative (static) model elements, such as classes, types, and their contents and relationships.

Object diagram encompasses objects and their relationships at a point in time. It may be considered a special case of a class diagram or a collaboration diagram.


class diagram

enter image description here

object diagram

enter image description here

A good powerpoint to start with: http://people.bu.edu/rfv/SC511/downloads/uml.ppt