Diagrams in Uml
Diagrams in Uml
Generalization
Object diagrams
Object diagrams also represent the static view of a system
but this static view is a snapshot of the system at a
particular moment.
An object diagram shows a set of objects and their
relationships
example
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
The following diagram is an example of an object diagram. It represents the Order management
system which we have discussed in the chapter Class Diagram. The following diagram is an instance
of the system at a particular time of purchase. It has the following objects.
•Customer
•Order
•SpecialOrder
•NormalOrder
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.
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.
Use case diagram
A use case diagram shows a set of use cases and actors and
their relationships
Use case diagrams address the static use case view of a system.
These diagrams are especially important in organizing and
modeling the behaviors of a system.
Interaction Diagrams
Both sequence diagrams and collaboration diagrams are
kinds of interaction diagrams
Interaction diagrams address the dynamic view of a
system
A sequence diagram is an interaction diagram that
emphasizes the time-ordering of messages