You are on page 1of 7

Presentation

Software Engineering

Submitted To:
Sir Adnan Mustafa

Submitted By:
Talha Niaz, M. Bilal, Nabeel Haider
17-cp-38, 17-cp-52, 17-cp-86
Object Diagram
What is Object Diagram?
Object Diagram gives static structure of objects and their relationship to one another.
These are useful for demonstration of system to customers. Object Modeling is
represented by using object diagram.
Object is an instance of a moment in runtime, including objects and data values. A
static UML 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, thus an 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 communication diagram.
 It is used to model instances of things contained in class diagram.
 It is a diagram that shows sets of objects and their relationship.
 It also represents static structure of system.
 Object Diagrams are derived from Class Diagram.
 Object Diagram is dependent on Class Diagram.
 Basic Concepts for Class and Object Diagrams are the same.

Purpose of Object Diagram:


The use of object diagrams is limited.
 It shows object relationships in a system.
 Understand object behavior and their relationships.
 Shows static view of a system.
 Forward and reverse engineering.
 During the analysis phase of a project, you might create a class diagram to
describe the structure of a system and then create a set of object diagrams as
test cases to verify the accuracy and completeness of the class diagram.
 Before you create a class diagram, you might create an object diagram to
discover facts about specific model elements and their links, or to illustrate
specific examples of the classifiers that are required.
 It should be understood Clearly to implement it practically. The purpose of
Object diagrams is like Class diagrams.
 The difference is that a Class diagram Represents an Abstract Model consisting
of classes and their relationships. However, an object diagram represents an
instance at moment, which is concrete in nature.
Terms and Concepts of Object Diagram:
1.Object:
It is instance of a class and each object is represented by a rectangle which contains
name of object and its class name underlined and separated by a colon.

2. Object with Attributes:


As with classes we can list object attributes in separate compartment. Each object
attributes must have values assigned to them.

3. Active Objects:
Objects that have their own processes that control their activities are called as active
objects. They are represented by a symbol of object with thick border lines.
4. Multiple Objects:
It is represented by a symbol as object if attributes of objects are not
important

5. Links:
These are the relationship between objects. Links are instances of association. It is
represented by solid line.

Relationship between objects can also be generalization or aggregation.

Generalization Symbol Aggregation Symbol


Objects that fulfill more than 1 role can be self-linked.
Where to use Object Diagram?
 Object Diagrams can be imagined as the snapshot of a running system at a
moment.
 Now if you take a snap of running train then you will find a static picture of it the
following:

Difference between Class and Object Diagrams:


 A class diagram is a graph of Classifier elements connected by their various
static relationships whereas an object diagram is a graph of instances, including
objects and data values.
 Class diagrams can contain objects, so a class diagram with objects and no
classes is an object diagram.
 Class diagrams are the blueprints of your system or subsystem whereas object
diagram shows a snapshot of the detailed state of a system at a point in time.
 An object diagram is a UML structural diagram that shows the instances of the
classifiers in models.
 Object diagrams use notation that is like that used in class diagrams.
 Object diagrams show specific instances of those classifiers and the links
between those instances at a point in time.
 You can create object diagrams by instantiating the classifiers in class,
deployment, component, and use-case diagrams.
Steps for Modeling Object Structures:
A communication diagram (called collaboration in previous version of UML) without
messages is also known as an object diagram, and the relationships between objects
are called links. An object diagram must be a valid instantiation of a static class
diagram. Objects must have classes and links between objects must be instances of
associations between classes. This can be used as a quick consistency check. To do
this we can develop an object diagram by using the following steps:
 Identify the mechanism you'd like to model. A mechanism represents
some functions or behaviors of the part of the system you are modeling that
results from the interaction of a society of classes, interfaces, and other things.
 For each mechanism, identify the classes, interfaces, and other elements that
participate in this collaboration; identify the relationships among these things,
as well.
 Consider one scenario that walks through this mechanism. Freeze that scenario
at a moment in time and render each object that participates in the mechanism.
 Expose the state and attribute values of each such object, as necessary, to
understand the scenario.
CASE STUDY:
Online shopping system
Class Diagram:
Object Diagram:

You might also like