Professional Documents
Culture Documents
How To Draw An Object Diagram?: Aggregation Association
How To Draw An Object Diagram?: Aggregation Association
Aggregation Association
Special kind of association where there is It means there is almost always a link
whole-part relation between two objects between objects
Diamond shape structure is used next to the Line segment is used between the
assembly class. components or the class
Use-case:
Use cases are used to represent high-level functionalities and how the user
will handle the system. A use case represents a distinct functionality of a
system, a component, a package, or a class. It is denoted by an oval shape
with the name of a use case written inside the oval shape. The notation of a
use case in UML is given below:
Actor:
It is used inside use case diagrams. The actor is an entity that interacts with
the system. A user is the best example of an actor. An actor is an entity that
initiates the use case from outside the scope of a use case. It can be any
element that can trigger an interaction with the use case. One actor can be
associated with multiple use cases in the system. The actor notation in UML is
given below.
i. Fork
A join node is opposite of a fork node as It has many incoming edges and a
single outgoing edge. It performs logical AND operation on all the incoming
edges. This helps you to synchronize the input flow across a single output
edge.
Polymorphism
If one task is performed in different ways, it is known as polymorphism. For example: to
convince the customer differently, to draw something, for example, shape, triangle,
rectangle, etc.
Another example can be to speak something; for example, a cat speaks meow, dog barks
woof, etc.
Encapsulation
Binding (or wrapping) code and data together into a single unit are known as encapsulation.
For example, a capsule, it is wrapped with different medicines.
A java class is the example of encapsulation. Java bean is the fully encapsulated class
because all the data members are private here.
State
In the state transition diagram, An object always remains in some state. Further, the state of the
object may change after an event occur.
Event
Any activity that may trigger a state transition or can change the state.
Guard
In the state transition diagram, a guard is a boolean expression. Suppose if the guard is true, then
it enables an event to trigger a transition.
Transition
The change of state within an object is represented with a transition. It is possible that an object
changes its state when the transition occurs.
Action
One or more actions are taken by an object when the object changes a state.
1. When the system has some dependencies on the events or on the values in the past.
2. State Transition diagram can be used when a software tester is testing the system for a finite set
of input values.
3. When the software tester focus is to understand the behavior of the object.
4. When the software tester focus is to test the sequence of events that may occur in the system
under test.
1. First of all, identify the object that you will create during the development of classes in oop
2. Identify the actions or events
3. Identify the possible states for an object
4. Draw the diagram.
Object: friends
Events or actions: Search to add a friend, add a friend, accept a friend, reject a friend,
again add, block user and close.
States: Start, the friend added, friend rejected, user blocked and end.
In the diagram whenever the user enters the correct PIN he is moved to
Access granted state, and if he enters the wrong password he is moved to
next try and if he does the same for the 3rd time the account blocked state is
reached.
S1) Start S5 S2
In the table when the user enters the correct PIN, state is transitioned to S5
which is Access granted. And if the user enters a wrong password he is
moved to next state. If he does the same 3rd time, he will reach the account
blocked state.
Use case diagram is a subset of various behaviour diagrams. Use case diagrams are used to
provide concrete examples of the elements which are supposed to implement. It is used to
analyze objects.
Actors: An actor is one of the entities who perform certain actions. These roles are the actual
business roles of the users in given system. An actor interacts with a use case of the system. For
example, for a banking system, a customer is one of the actors.
Use Case: A use case is a use case diagram of UML represents a business functionality that is
distinct. The use case should list the discrete business functionality that is specified in the
problem statement. Every business functionality is a potential use case.
System boundary: A system boundary defines the scope of the system. The systems that use
cases also need to be defined in the limits of the system. The system boundary is shown as a
rectangle that spans all use cases of the system.
Class diagram is a static diagram. It represents the static view of an application. Class diagram is
not only used for visualizing, describing, and documenting different aspects of a system but also
for constructing executable code of the software application.
Class diagram describes the attributes and operations of a class and also the constraints imposed
on the system..
First of all, Order and Customer are identified as the two elements of the system. They
have a one-to-many relationship because a customer can have multiple orders.
Order class is an abstract class and it has two concrete classes (inheritance relationship)
SpecialOrder and NormalOrder.
The two inherited classes have all the properties as the Order class. In addition, they have
additional functions like dispatch () and receive ().
The following class diagram has been drawn considering all the points mentioned above.
The purpose of class diagram is to model the static view of an application. Class diagrams are the
only diagrams which can be directly mapped with object-oriented languages and thus widely used
at the time of construction.
The purpose of the class diagram can be summarized as −