Before learning about object diagrams in UML, have a look at class diagrams in UML.
An object diagram models the instances of classes in a class diagram. An object diagram contains objects and links connecting the related objects.
Object diagrams allow us to model the static design view or static process view. It involves modeling a snapshot of the system which contains objects (instances), their state and links between objects.
An object diagram represents the static part of an interaction containing the objects that communicate and the links between them without any messages.
Contents
Common Properties
An object diagram shares the same common properties like the rest of the diagrams, a name which identifies the diagram and graphical contents which are a projection into the model. What distinguish an object diagram from the rest of the diagrams are its contents.
Contents
Object diagrams contain:
- Objects
- Links
Like all other diagrams, object diagrams may contain notes and constraints.
Object diagrams may also contain packages and subsystems which are used to group the related elements in the model together. Sometimes we can also include classes in the object diagrams. Generally, object diagrams are used to model the object structures.
Common Modeling Techniques
Modeling Object Structures
To model an object structure,
- First, identify the function or behavior or part of a system you want to model as collection of classes, interfaces and other things.
- For each function or mechanism identify the classes and interfaces that collaborate and also identify the relationships between them.
- Consider a scenario (context) that walks through this mechanism and freeze at a moment in time and identify the participating objects.
- Represent the state of objects by listing out the attributes and their values.
- Represent the links between objects which are instances of associations.
Forward and Reverse Engineering
Forward engineering a object diagram is theoretically possible but practically of limited value as the objects are created and destroyed dynamically at runtime, we cannot represent them statically.
To reverse engineer a object diagram,
- Choose the target (context) you want to reverse engineer.
- Use a tool to stop execution at a certain moment in time.
- Identify the objects that collaborate with each other and represent them in an object diagram.
- To understand their semantics, expose these object’s states.
- Also identify the links between the objects to understand their semantics.
Suryateja Pericherla, at present is a Research Scholar (full-time Ph.D.) in the Dept. of Computer Science & Systems Engineering at Andhra University, Visakhapatnam. Previously worked as an Associate Professor in the Dept. of CSE at Vishnu Institute of Technology, India.
He has 11+ years of teaching experience and is an individual researcher whose research interests are Cloud Computing, Internet of Things, Computer Security, Network Security and Blockchain.
He is a member of professional societies like IEEE, ACM, CSI and ISCA. He published several research papers which are indexed by SCIE, WoS, Scopus, Springer and others.
Leave a Reply