0% found this document useful (0 votes)
28 views

Practical 8

The document discusses UML diagrams including class diagrams, sequence diagrams, collaboration diagrams, and state transition diagrams. It provides notation explanations and examples of each. Class diagrams show classes, attributes, methods and relationships. Sequence diagrams depict object interactions over time. Collaboration diagrams show object relationships and behavior. State transition diagrams represent system states and events that cause state changes. The conclusion is that UML diagrams were successfully drawn for the given project to model its structure and behavior.

Uploaded by

geet.more15
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Practical 8

The document discusses UML diagrams including class diagrams, sequence diagrams, collaboration diagrams, and state transition diagrams. It provides notation explanations and examples of each. Class diagrams show classes, attributes, methods and relationships. Sequence diagrams depict object interactions over time. Collaboration diagrams show object relationships and behavior. State transition diagrams represent system states and events that cause state changes. The conclusion is that UML diagrams were successfully drawn for the given project to model its structure and behavior.

Uploaded by

geet.more15
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Practical 8

Title:
Draw Class diagram, sequence diagram, collaboration diagram, state transition diagram, for the
assigned project.

Theory:
● Class diagram:
In software engineering a Class diagram in the UML(Unified Modelling Language) is a type
of static structure diagram that describes the structure of a system by showing the system classes, their
attributes, operations(or methods) and the relationships among objects.

Class diagram notation consists of three parts -


Class name The name of the class appears in the first partition

Class attributes Attributes are shown in the second partition. They map on to member
variables in code
Class methods Methods are shown in the third partition. They are services the class
provides
Relationships
Existing relationships in a system describe legitimate connections between the classes in that system.

● Association
It is an instance level relationship that allows exchanging messages among the objects of both ends of
association. A simple straight line connecting two class boxes represent an association. We can give a
name to association and also at the both end we may indicate role names and multiplicity of the adjacent
classes. Association may be uni-directional.
Example:
In structure model for a system of an organization an employee (instance of ‘Employee’ class) is always
assigned to a particular department (instance of ‘Department’ class) and the association can be shown
by a line connecting the respective classes.

● Aggregation
It is a special form of association which describes a part-whole relationship between a pair of classes.
It means, in a relationship, when a class holds some instances of related class, then that relationship can
be designed as an aggregation.
Example:
For a supermarket in a city, each branch runs some of the departments they have. So, the relation among
the classes ‘Branch’ and ‘Department’ can be designed as an aggregation.
In UML, it can be shown as in the fig. below
● Composition:
It is a strong from of aggregation which describes that whole is completely owns its part. Life
cycle of the part depends on the whole.
Example:
Let consider a shopping mall has several branches in different locations in a city.The existence of
branches completely depends on the shopping mall as if it is not exist any branch of it will no longer
exists in the city.
This relation can be described as composition and can be shown as below

Multiplicity:
It describes how many numbers of instances of one class is related to the number of instances of
another class in an association.

Example:
One vehicle may have two or more wheels.
● Sequence diagram:
Sequence diagram simply depicts interaction between objects in a sequential order. Sequence
diagram describe how and in what order the objects in a system functions. These diagrams are widely
used by businessman and software developers to document and understand requirements for new and
existing systems.

Sequence diagram notations:


A sequence diagram is structured in such a way that it represents a timeline which begins at the top
and descends gradually to mark the sequence of interactions. Each object has a column and the
messages exchanged between them are represented by arrows.

Name Symbol
Actor

Lifelines
Message:
A message can flow in any
direction; from left to right,
right to left or back to the
Message Caller itself.
1)a Synchronous message is
used when the sender waits for
the receiver to process the
message and return before
carrying on with another
message. The arrowhead used
to indicate this type of message
is a solid one.
2)An Asynchronous message
is used when the message caller
does not wait for the receiver to
process the message and return
before sending other messages
to other objects within the
system. The arrowhead used to
show this type of message is a
line arrow like shown in the
example below
3) Participant destruction
message:
participants when no longer
needed can also be deleted
from a sequence diagram. This
is done by adding an ‘X’ at the
end of the lifeline of the said
participant.
4)Reflexive message

When an object sends a


message to itself, it is called a
reflexive message. It is
indicated with a message arrow
that starts and ends at the same
lifeline as shown in the given
example

Comment

UML diagrams generally


permit the annotation of
comments in all UML diagram
types. The comment object is a
rectangle with a folded-over
corner as shown .

The comment can be linked to


the related object with a dashed
line.
● Collaboration diagram:
Collaboration diagram is also called as communication or interaction diagram. It is an illustration of
the relationships among software objects in UML.
A collaboration diagram resembles a flowchart that portrays the roles, functionality and behaviour of
individual objects as well as the overall operation of the system in real time.

Collaboration diagram notations:

Sr no Name Icon
1 Object
ObjectName : Class Name

3 Association Role

5 Link to self
ObjectName : Class Name

6 Message
ObjectName : Class Name

message

ObjectName : Class Name

7 Note
● State transition diagram:
The state transition diagram is one method for representing the behaviour of a system
By depicting its states and the events that cause the system to change state. In addition, the state
diagram indicates actions taken as a consequence of a particular event.
State transition diagram notations:

Sr no Name Symbol

1 State

2 Start/initial state

3 Final/end state

4 Transition

5 Decision

Conclusion:
Thus, we have successfully drawn class diagram , sequence diagram, collaboration diagram and state
transition diagram for give project.

You might also like