Instances, not types
Object diagrams show specific objects such as order#1024 and shipment#S-88, not just the classes Order and Shipment.
Object diagrams are less commonly discussed than class diagrams, but they become useful when you need to show a specific runtime snapshot. Instead of describing classes in general, they show particular object instances and their links at one moment in time. That makes them surprisingly helpful for debugging understanding, examples, and onboarding.
In the order domain, a concrete snapshot like one Order linked to a specific Payment and Shipment can clarify the model much faster than a more abstract class diagram when the audience needs an example rather than a taxonomy.
Object diagrams answer the question, “what does a concrete slice of this model look like right now?” That makes them especially useful for scenario explanation, complex aggregate examples, and debugging-oriented design discussion.
For Java developers, object diagrams can complement class diagrams by grounding the structure in a realistic example. This often helps when abstract class relationships feel too generic or when the design uses value objects and associations that are easier to understand with sample data.
They are not a replacement for sequence or state diagrams. Their value is in concrete shape, not flow.
Object diagrams show specific objects such as order#1024 and shipment#S-88, not just the classes Order and Shipment.
They capture one moment in the system, which makes them good for examples and state inspection.
They work well when abstract structure alone feels too distant from what actually exists at runtime.
package org.javaomnibus.ecommerce.uml;
public record OrderSnapshot(
String orderId,
String customerId,
String paymentId,
String shipmentId,
String status
) {}
public final class SnapshotFactory {
public OrderSnapshot from(Order order, Payment payment, Shipment shipment) {
return new OrderSnapshot(order.id(), order.customerId(), payment.id(), shipment.id(), order.status());
}
}
Object diagrams can become stale quickly if readers treat them as exhaustive. They should be understood as examples or snapshots, not full model documentation.