Object Diagram Tutorial

What is an object diagram in UML?

UML provides a set of conventions for software engineers looking to create visual diagrams for their systems. An object diagram creates a high-level overview of your system.

It’s easy to create high-quality object diagrams in Lucidchart. With an extensive UML shape library, you can customize the look and content of your diagram.

Demo here
Sign up free

What is an Object Diagram in UML?

A UML object diagram represents a specific instance of a class diagram at a certain moment in time. When represented graphically you'll see many similarities to the class diagram. We used the same Car class example from the class diagram page to illustrate object diagrams. Our UML shape library can help you design any custom object diagram using our UML online tool

Object Diagram vs Class Diagram

object diagram
Object Diagram Example
object diagram vs class diagram
Class Diagram Example

An object diagram focuses on the attributes of a set of objects and how those objects relate to each other. For instance, in this object diagram below, all three bank accounts tie back to the bank itself. The class titles show the kind of accounts (savings, checking, and credit card) that a given customer could have with this particular bank. The class attributes are different for each kind of account. This is illustrated by the credit card object having a credit limit, while the savings and checking accounts have interest rates. Object diagram are not limited to banking use cases. You can make an object diagram for family trees, corporate departments—any system with interrelated parts.

object diagram example

Object Diagram Applications

There are many instances where a developer will find object diagrams useful. These include:

  • Examining a specific iteration of a general system.
  • Getting a high-level overview of the system you will develop.
  • Testing a class diagram you’ve created for the overall structure of the system, using object diagrams for specific use cases.

Object Diagram Elements

Object diagrams are simple to create: they're made from objects, represented by rectangles, linked together with lines. These are the major elements of an object diagram:

  • Objects - are instances of a class. If a car is a class, a 2007 Nissan Altima is an object of a class. The objects in the class “Parents” are your specific parents, for instance, Elaine and Gary.
  • Class titles - the specific attributes of the class. In the family tree object diagram, this is the name, gender, and age of the family members. These can be listed as items on the object, or even in the properties of the object itself (such as color).
  • Class attributes - a rectangle with two tabs that indicates a software element.
  • Links - these are the lines connecting one object to another. The corporate object diagram below shows how departments are connected in the traditional organizational chart style.
What is an object diagram in UML?

Other UML Object Diagram Examples

The UML specifications don't really change when you're describing an objective diagram in different programming languages. The whole point of UML is so that you can plan out software independent of specific platforms. Below are the most commonly searched types of object diagram types in different programming languages.

Objective C Object Diagram

Objective C has become very popular since Apple's release of "Objective C 2.0", and now it's the programming language of choice for Apple marketplace applications. Someone searching for an Objective C object diagram is probably attempting to show instances for an iPhone app.

Java Object Diagram

This term needs a little disambiguation. There are object diagram that can be used in UML to describe instances that would ultimately be programmed in Java. There also exist diagrams which describe Java objects that have nothing to do with UML. Whether you are looking for the former or the latter, Lucidchart can help map the structure you need to create. Click here to try out our demo.

Object Diagram Resources

Use Lucidchart to collaborate and create UML diagrams when you start an account for free today! No plugins or download required.

Sign up