2. PresentedBy
M. Bilal Aslam 753203
Abdullah 753223
Zunaira Azeem 753227
Nafeesa Shahid 2753217
PresentedTo
MamFiza Tariq
Class BS.IT 5th (M)
Topic Object Diagram
3. An object diagram is a UML structural diagram that shows
the instances of the classifiers in models. Object diagrams use
notation that is similar to that used in class diagrams. Object
diagrams show specific instances of those classifiers and the
links between those instances at a point in time.
Object diagram shows a snapshot of the detailed state of a
system at a point in time, thus an object diagram
encompasses objects and their relationships which may be
considered a special case of a class diagram or
a communication diagram.
4. 1. Before drawing an object diagram, one should analyze all
the objects inside the system.
2. The relations of the object must be known before creating
the diagram.
3. Association between various objects must be cleared
before.
4. An object should have a meaningful name that describes
its functionality.
5. An object must be explored to analyze various
functionalities of it.
5. The use of object diagrams is fairly limited, mainly to
show examples of data structures.
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.
6. Object Names:
Every object is actually symbolized like a rectangle, that offers
the name from the object and its class underlined as well as
divided with a colon.
Object Attributes:
Similar to classes, you are able to list object attributes inside a
separate compartment. However, unlike classes, object
attributes should have values assigned for them.
Links:
Links tend to be instances associated with associations. You
can draw a link while using the lines utilized in class
diagrams.
7. The following diagram is an instance of the
system at a particular time of purchase. It has
the following objects. Customer, Order,
Special Order, Normal Order.
Now the customer object (C) is associated
with three order objects (O1, O2, and O3).
These order objects are associated with
special order and normal order objects (S1,
S2, and N1). The customer has the following
three orders with different numbers (12, 32
and 40) for the particular time considered.
8. The customer can increase the number of orders in future
and in that scenario the object diagram will reflect that. If
order, special order, and normal order objects are observed
then you will find that they have some values. For orders,
the values are 12, 32, and 40 which implies that the objects
have these values for a particular moment (here the
particular time when the purchase is made is considered as
the moment) when the instance is captured The same is true
for special order and normal order objects which have
number of orders as 20, 30, and 60. If a different time of
purchase is considered, then these values will change
accordingly.
11. Where to Use Object Diagrams?
Object diagrams can be imagined as the
snapshot of a running system at a
particular moment. Let us consider an
example of a running train
Now, if you take a snap of the running
train then you will find a static picture of
it having the following −
A particular state which is running.
A particular number of passengers.
which will change if the snap is taken
in a different time.
12. Where to Use Object Diagrams?
Here, we can imagine the snap of the
running train is an object having the
above values. And this is true for any real-
life simple or complex system.
In a nutshell, it can be said that object
diagrams are used for:
Making the prototype of a system.
Reverse engineering.
Modeling complex data structures.
Understanding the system from
practical perspective.