0% found this document useful (0 votes)
11 views39 pages

Module 1 Chapter-1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views39 pages

Module 1 Chapter-1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

OOP using JAVA http://www.youtube.

com/c/EDULINEFORCSE
STUDENTS

MODULE 1- INTRODUCTION

CHAPTER – 1
Approaches to Software Design
Prepared By Mr. EBIN P.M , AP CSE,IESCE 1

Software & Software Design


Software
• Software is a collection of instructions that enable the user to
interact with a computer , its hardware or perform tasks
• Without software, most computers would be useless. For
example, without your Internet browser software, you could
not surf the Internet. Without an operating system, the browser
could not run on your computer.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 2

Prepared By MR.EBIN PM (AP) , IESCE 1


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

There are two types of software


1. System Software
2. Application Software
Examples of system software are Operating System, Compilers,
Interpreter, Assemblers, etc.
Examples of Application software are Railways Reservation
Software, Microsoft Office Suite Software, Microsoft Word,
Microsoft PowerPoint , etc.

System Software's Application software's


Prepared By Mr. EBIN P.M , AP CSE,IESCE 3

Software Design
Software design is a process to transform user requirements into
some suitable form, which helps the programmer in software
coding and implementation.
The design process for software systems often has two levels. At
the first level the focus is on deciding which modules are needed
for the system on the basis of SRS (Software Requirement
Specification) and how the modules should be interconnected.
Software design is the first step in SDLC (Software Design Life
Cycle)
It tries to specify how to fulfill the requirements mentioned in
SRS document.
Prepared By Mr. EBIN P.M , AP CSE,IESCE 4

Prepared By MR.EBIN PM (AP) , IESCE 2


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

Functional Oriented Design (FOD)


In function-oriented design, the system is comprised of many
smaller sub-systems known as functions.
These functions are capable of performing significant task in
the system
Function oriented design inherits some properties of
structured design where divide and conquer methodology is
used.
This design mechanism divides the whole system into smaller
functions
Prepared By Mr. EBIN P.M , AP CSE,IESCE 5

These functional modules can share information among


themselves by means of information passing and using
information available globally.

Eg: Banking process


Here withdraw, Deposit, Transfer are
functions and that can be divided in to sub-
functions again.
So, in FOD, the entire problem is divided in
to number of functions and those functions
are broken down in to smaller functions
and these smaller functions are converted
in to software modules.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 6

Prepared By MR.EBIN PM (AP) , IESCE 3


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

Object Oriented Design (OOD)


OOD is based on Objects and interaction between the objects
Interaction between objects is called message communication.
It involves the designing of Objects, Classes and the
relationship between the classes
Consider the previous example of
Banking process.
Here, customer, money and account
are objects

Prepared By Mr. EBIN P.M , AP CSE,IESCE 7

In OOD, implementation of a software based on the concepts


of objects.
This approach is very close to the real-world applications
Basic Object Oriented concepts

Prepared By Mr. EBIN P.M , AP CSE,IESCE 8

Prepared By MR.EBIN PM (AP) , IESCE 4


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

OBJECT
Objects are real-world entities that has their own properties
and behavior.
It has physical existence
Eg: person, banks, company, customers etc
CLASS
A class is a blueprint or prototype from which objects are
created
A class is a generalized description of an object.
An object is an instance of a class

Prepared By Mr. EBIN P.M , AP CSE,IESCE 9

Relationship between Object & Class


Let’s take Human Being as a class. My name is John, and I am an
instance/object of the class Human Being
Object has a physical existence while a class is just a logical
definition.
Encapsulation
The wrapping up of data(variables) and function (methods) into
a single unit (called class) is known as encapsulation.
It is also called "information hiding“

Prepared By Mr. EBIN P.M , AP CSE,IESCE 10

Prepared By MR.EBIN PM (AP) , IESCE 5


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

Key Points of Encapsulation


• Protection of data from accidental corruption
• Flexibility and extensibility of the code and reduction in complexity
• Encapsulation of a class can hide the internal details of how an object
does something
• Encapsulation protects abstraction

Prepared By Mr. EBIN P.M , AP CSE,IESCE 11

ABSTRACTION
Abstraction means displaying only essential information and
hiding the details.
Data abstraction refers to providing only essential information
about the data to the outside world, hiding the background
details or implementation.
Consider a real-life example of a man driving a car. The man
only knows that pressing the accelerators will increase the
speed of the car or applying brakes will stop the car but he does
not know about how on pressing accelerator the speed is
actually increasing, he does not know about the inner
mechanism of the car or the implementation of accelerator,
brakes etc in the car. This is what abstraction is.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 12

Prepared By MR.EBIN PM (AP) , IESCE 6


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

Abstraction & Encapsulation

Prepared By Mr. EBIN P.M , AP CSE,IESCE 13

POLYMORPHISM
The word polymorphism means having many forms
In simple words, we can define polymorphism as the ability of a
message to be displayed in more than one form.
Eg: A person at the same time can have different characteristic.
Like a man at the same time is a father, a husband, an employee.
So the same person posses different behavior in different
situations. This is called polymorphism.
An operation may exhibit different behaviors in different
instances. The behavior depends upon the types of data used in
the operation.
Prepared By Mr. EBIN P.M , AP CSE,IESCE 14

Prepared By MR.EBIN PM (AP) , IESCE 7


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

Fig: polymorphism

Prepared By Mr. EBIN P.M , AP CSE,IESCE 15

Inheritance
The capability of a class to derive properties and characteristics
from another class is called Inheritance.
OR
Inheritance is the process by which objects of one class acquired
the properties of objects of another classes
 Sub Class : The class that inherits properties from another class
is called Sub class or Derived Class.
 Super Class : The class whose properties are inherited by sub
class is called Base Class or Super class.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 16

Prepared By MR.EBIN PM (AP) , IESCE 8


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

 Reusability: Inheritance supports the concept of “reusability”,


i.e. when we want to create a new class and there is already a
class that includes some of the code that we want, we can
derive our new class from the existing class. By doing this, we
are reusing the fields and methods of the existing class.

Eg: Dog, Cat, Cow can be


Derived Class of Animal Base
Class.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 17

Unified Modeling Language (UML)


UML (Unified Modeling Language) is a general-purpose,
graphical modeling language in the field of Software Engineering
UML is used to specify, visualize, construct, and document the
artifacts (major elements) of the software system
UML is a visual language for developing software blue prints
(designs). A blue print or design represents the model.
For example, while constructing buildings, a designer or
architect develops the building blueprints. Similarly, we can also
develop blue prints for a software system.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 18

Prepared By MR.EBIN PM (AP) , IESCE 9


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

UML is the most commonly and frequently used language for


building software system blueprints
UML is not a programming language, it is rather a visual
language.
The UML has the following features:
• It is a generalized modeling language.
• It is distinct from other programming languages like C++,
Python, etc.
• It is interrelated to object-oriented analysis and design.
• It is used to visualize the workflow of the system.
• It is a pictorial language, used to generate powerful modeling
artifacts
Prepared By Mr. EBIN P.M , AP CSE,IESCE 19

UML is linked with object oriented design and analysis


Diagrams in UML can be broadly classified as:
Structure Diagrams : Capture static aspects or structure of a system
Behavior Diagrams: Capture dynamic aspects or behavior of the
system

Prepared By Mr. EBIN P.M , AP CSE,IESCE 20

Prepared By MR.EBIN PM (AP) , IESCE 10


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

CLASS DIAGRAM
The most widely use UML diagram is the class diagram. It is the
building block of all object oriented software systems.
Using class diagrams we can create the static structure of a system
by showing system’s classes, their methods and attributes.
Class diagrams also help us identify relationship between different
classes or objects.
There are several software available which can be used online and
offline to draw these diagrams Like Edraw max, lucid chart etc.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 21

Class & Object

Prepared By Mr. EBIN P.M , AP CSE,IESCE 22

Prepared By MR.EBIN PM (AP) , IESCE 11


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

Class Notation
A class 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.
• The attribute type is shown after the colon.
• Attributes map onto member variables (data members) in code.
Class Operations (Methods):
• Operations are shown in the third partition. They are services the class provides.
• The return type of a method is shown after the colon at the end of the method
signature.
• The return type of method parameters are shown after the colon following the
parameter name. Operations map onto class methods in code
Prepared By Mr. EBIN P.M , AP CSE,IESCE 23

The +, - and # symbols before an attribute and operation name in


a class denote the visibility of the attribute and operation.
+ denotes public attributes or operations
- denotes private attributes or operations
# denotes protected attributes or operations

Prepared By Mr. EBIN P.M , AP CSE,IESCE 24

Prepared By MR.EBIN PM (AP) , IESCE 12


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

Relationships between classes

Prepared By Mr. EBIN P.M , AP CSE,IESCE 25

1. Dependency
• A dependency means the relation between two or more classes
in which a change in one may force changes in the other.
• Dependency indicates that one class depends on another.
• A dashed line with an open arrow

2. Inheritance (or Generalization)


• A generalization helps to connect a subclass to its superclass.
• A sub-class is inherited from its superclass.
• A solid line with a hollow arrowhead that point from the child
to the parent class

Prepared By Mr. EBIN P.M , AP CSE,IESCE 26

Prepared By MR.EBIN PM (AP) , IESCE 13


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

Fig: Inheritance (or Generalization)

3. Association
• This kind of relationship represents static relationships between
classes A and B.
• There is an association between Class1 and Class2
• A solid line connecting two classes
Prepared By Mr. EBIN P.M , AP CSE,IESCE 27

Fig: Association

4. Aggregation
• A special type of association. It represents a "part of" relationship
• Class2 is part of Class1.

• Many instances (denoted by the *) of Class2 can be associated


with Class1.
• A solid line with an unfilled diamond at the association end
connected to the class of composite

Prepared By Mr. EBIN P.M , AP CSE,IESCE 28

Prepared By MR.EBIN PM (AP) , IESCE 14


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

5. Composition
• A special type of aggregation where parts are destroyed when
the whole is destroyed.
• Objects of Class2 live and die with Class1.
• Class2 cannot stand by itself.
• A solid line with a filled diamond at the association connected
to the class of composite

Prepared By Mr. EBIN P.M , AP CSE,IESCE 29

Multiplicity
• It means, how many objects of each class take part in the
relationships
• Exactly one - 1
• Zero or one - 0..1
• Many - 0..* or *
• One or more - 1..*
• Exact Number - e.g. 3..4 or 6
• Or a complex relationship - e.g. 0..1, 3..4, 6.* would mean any
number of objects other than 2 or 5

Prepared By Mr. EBIN P.M , AP CSE,IESCE 30

Prepared By MR.EBIN PM (AP) , IESCE 15


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

Eg: Class diagram for an ATM system

Prepared By Mr. EBIN P.M , AP CSE,IESCE 31

USE CASE MODEL / USE CASE DIAGRAM


The purpose of a use case diagram in UML is to demonstrate the
different ways that a user might interact with a system.
It captures the dynamic behavior of a live system.
a use case diagram can summarize the details of your system's
users (also known as actors) and their interactions with the
system.
To build a use case diagram, we will use a set of specialized
symbols and connectors
A use case diagram doesn't go into a lot of detail, but it depicts a
high-level overview of the relationship between use cases, actors,
and systems.
Prepared By Mr. EBIN P.M , AP CSE,IESCE 32

Prepared By MR.EBIN PM (AP) , IESCE 16


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

A use-case model is a model of how different types of users


interact with the system to solve a problem
Use case diagram components
• Actors: The users that interact with a system. An actor can be a
person, an organization, or an outside system that interacts with
your application or system. They must be external objects that
produce or consume data.
• System: A specific sequence of actions and interactions between
actors and the system. A system may also be referred to as a
scenario
• Goals: The end result of most use cases. A successful diagram
should describe the activities and variants used to reach the goal.
Prepared By Mr. EBIN P.M , AP CSE,IESCE 33

Use case diagram symbols and notation


1. Use cases
• Horizontally shaped ovals that represent the different uses that a
user might have
• A use case represents a distinct functionality of a system, a
component, a package, or a class

Prepared By Mr. EBIN P.M , AP CSE,IESCE 34

Prepared By MR.EBIN PM (AP) , IESCE 17


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

2. Actors
• Stick figures that represent the people actually employing the use
cases.
• A user is the best example of an actor
• One actor can be associated with multiple use cases in the system

Prepared By Mr. EBIN P.M , AP CSE,IESCE 35

3. Associations
• A line between actors and use cases
• In complex diagrams, it is important to know which actors are
associated with which use cases.
4. System boundary boxes
• A box that sets a system scope to use cases
• All use cases outside the box would be considered outside the
scope of that system.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 36

Prepared By MR.EBIN PM (AP) , IESCE 18


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

5. Packages
• A UML shape that allows you to put different elements into groups
• Just as with component diagrams, these groupings are represented
as file folders.

purposes of use case diagram


Used to gather the requirements of a system.
Used to get an outside view of a system.
Identify the external and internal factors influencing the system.
Show the interaction among the requirements and actors

Prepared By Mr. EBIN P.M , AP CSE,IESCE 37

Eg: Use case diagram of a student management system

Prepared By Mr. EBIN P.M , AP CSE,IESCE 38

Prepared By MR.EBIN PM (AP) , IESCE 19


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

Eg: ATM use case diagram

Prepared By Mr. EBIN P.M , AP CSE,IESCE 39

<<extend>> Use Case


The <<extend>> use case inserting additional action sequences into the
base use-case sequence.

<<include>> Use Case


The time to use the <<include>> relationship is after you have completed
the first cut description of all your main Use Cases.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 40

Prepared By MR.EBIN PM (AP) , IESCE 20


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

Prepared By Mr. EBIN P.M , AP CSE,IESCE 41

INTERACTION DIAGRAM
INTERACTION DIAGRAMS are used in UML to establish
communication between objects
Interaction diagrams mostly focus on message passing and how
these messages make up one functionality of a system
The critical component in an interaction diagram is lifeline and
messages.
 Interaction diagrams capture the dynamic behavior of any system
The details of interaction can be shown using several notations
such as sequence diagram, timing diagram, collaboration diagram.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 42

Prepared By MR.EBIN PM (AP) , IESCE 21


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

Notation of an Interaction Diagram

Prepared By Mr. EBIN P.M , AP CSE,IESCE 43

Purpose of an Interaction Diagram


• To capture the dynamic behavior of a system.
• To describe the message flow in the system.
• To describe the structural organization of the objects.
• To describe the interaction among objects.
• Interaction diagram visualizes the communication and sequence of
message passing in the system.
• Interaction diagram represents the ordered sequence of
interactions within a system.
• Interaction diagrams can be used to explain the architecture of an
object-oriented system.
Prepared By Mr. EBIN P.M , AP CSE,IESCE 44

Prepared By MR.EBIN PM (AP) , IESCE 22


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

Different types of Interaction Diagrams


1. Sequence diagram
• Purpose - To visualize the sequence of a message flow in the system
• Shows the interaction between two lifelines
2. Collaboration diagram
• Also called as a communication diagram
• Shows how various lifelines in the system connects.
3. Timing diagram
• Focus on the instance at which a message is sent from one object to
another object.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 45

How to draw a Sequence Diagram

Prepared By Mr. EBIN P.M , AP CSE,IESCE 46

Prepared By MR.EBIN PM (AP) , IESCE 23


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

• In a sequence diagram, a lifeline is represented by a vertical bar.


• A lifeline represents an individual participant in a sequence
diagram
• A lifeline will usually have a rectangle containing its object name
• A message flow between two or more objects is represented
using a vertical dotted line which extends across the bottom of
the page.
• In a sequence diagram, different types of messages and operators
are used
• In a sequence diagram, iteration and branching are also used.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 47

Messages used

Prepared By Mr. EBIN P.M , AP CSE,IESCE 48

Prepared By MR.EBIN PM (AP) , IESCE 24


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

Sequence diagram example

Prepared By Mr. EBIN P.M , AP CSE,IESCE 49

Benefits of a Sequence Diagram


• Sequence diagrams are used to explore any real application or a
system.
• Sequence diagrams are used to represent message flow from one
object to another object.
• Sequence diagrams are easier to maintain.
• Sequence diagrams are easier to generate.
• Sequence diagrams can be easily updated according to the
changes within a system.
• Sequence diagram allows reverse as well as forward engineering.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 50

Prepared By MR.EBIN PM (AP) , IESCE 25


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

Drawbacks of a sequence diagram


• Sequence diagrams can become complex when too many lifelines
are involved in the system.
• If the order of message sequence is changed, then incorrect
results are produced.
• Each sequence needs to be represented using different message
notation, which can be a little complex.
• The type of message decides the type of sequence inside the
diagram

Prepared By Mr. EBIN P.M , AP CSE,IESCE 51

How to draw a Collaboration /Communication Diagram

Prepared By Mr. EBIN P.M , AP CSE,IESCE 52

Prepared By MR.EBIN PM (AP) , IESCE 26


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

As per Object-Oriented Programming (OOPs), an object entity


has various attributes associated with it.
Usually, there are multiple objects present inside an object-
oriented system where each object can be associated with any
other object inside the system
Collaboration Diagrams are used to explore the architecture of
objects inside the system.
The message flow between the objects can be represented using
a collaboration diagram.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 53

Collaboration Diagram Example

Prepared By Mr. EBIN P.M , AP CSE,IESCE 54

Prepared By MR.EBIN PM (AP) , IESCE 27


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

The above collaboration diagram represents a student


information management system. The flow of communication in
the above diagram is given by,
• A student requests a login through the login system.
• An authentication mechanism of software checks the request.
• If a student entry exists in the database, then the access is
allowed; otherwise, an error is returned.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 55

Benefits of Collaboration Diagram


• It is also called as a communication diagram.
• It emphasizes the structural aspects of an interaction diagram -
how lifeline connects.
• Its syntax is similar to that of sequence diagram except that lifeline
don't have tails.
• Messages passed over sequencing is indicated by numbering each
message hierarchically.
• It allows you to focus on the elements rather than focusing on the
message flow as described in the sequence diagram.
• Sequence diagrams can be easily converted into a collaboration
diagram as collaboration diagrams are not very expressive.
Prepared By Mr. EBIN P.M , AP CSE,IESCE 56

Prepared By MR.EBIN PM (AP) , IESCE 28


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

Drawbacks of a Collaboration Diagram


• Collaboration diagrams can become complex when too many
objects are present within the system.
• It is hard to explore each object inside the system.
• Collaboration diagrams are time consuming.
• The object is destroyed after the termination of a program.
• The state of an object changes momentarily, which makes it
difficult to keep track of every single change the occurs within an
object of a system.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 57

How to draw a Timing Diagram

Prepared By Mr. EBIN P.M , AP CSE,IESCE 58

Prepared By MR.EBIN PM (AP) , IESCE 29


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

In the above diagram, first, the software passes through the
requirements phase then the design and later the development
phase.
The output of the previous phase at that given instance of time
is given to the second phase as an input
Thus, the timing diagram can be used to describe SDLC (Software
Development Life Cycle) in UML.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 59

Benefits of a Timing Diagram


• Timing diagrams are used to represent the state of an object at a
particular instance of time.
• Timing diagram allows reverse as well as forward engineering.
• Timing diagram can be used to keep track of every change inside
the system.
Drawbacks of a Timing Diagram
• Timing diagrams are difficult to understand.
• Timing diagrams are difficult to maintain.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 60

Prepared By MR.EBIN PM (AP) , IESCE 30


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

ACTIVITY DIAGRAM
ACTIVITY DIAGRAM is basically a flowchart to represent the flow
from one activity to another activity.
The activity can be described as an operation of the system
 The basic purpose of activity diagrams is to capture the dynamic
behavior of the system
It is also called object-oriented flowchart
Activity diagrams are not only used for visualizing the dynamic
nature of a system, but they are also used to construct the
executable system by using forward and reverse engineering
techniques.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 61

Basic components of an activity diagram


• Action: A step in the activity wherein the users or software
perform a given task.
• Decision node: A conditional branch in the flow that is represented
by a diamond. It includes a single input and two or more outputs.
• Control flows: Another name for the connectors that show the
flow between steps in the diagram.
• Start node: Symbolizes the beginning of the activity. The start node
is represented by a black circle.
• End node: Represents the final step in the activity. The end node is
represented by an outlined black circle.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 62

Prepared By MR.EBIN PM (AP) , IESCE 31


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

Activity diagram symbols


• Start symbol - Represents the beginning of a process or workflow
in an activity diagram.
• Activity symbol - Indicates the activities that make up a modeled
process. These symbols, which include short descriptions within
the shape, are the main building blocks of an activity diagram.
• Connector symbol - Shows the directional flow, or control flow, of
the activity.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 63

• Joint symbol / Synchronization bar - Combines two concurrent


activities and re-introduces them to a flow where only one activity
occurs at a time. Represented with a thick vertical or horizontal
line.
• Fork symbol - Splits a single activity flow into two concurrent
activities. Symbolized with multiple arrowed lines from a join.
• Decision symbol - Represents a decision and always has at least
two paths branching out with condition text.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 64

Prepared By MR.EBIN PM (AP) , IESCE 32


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

• Note symbol - Allows the diagram creators or collaborators to


communicate additional messages that don't fit within the diagram
itself. Leave notes for added clarity and specification.
• Send signal symbol - Indicates that a signal is being sent to a
receiving activity
• Receive signal symbol - Demonstrates the acceptance of an event.
After the event is received, the flow that comes from this action is
completed.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 65

• Flow final symbol - Represents the end of a specific process flow.


This symbol shouldn’t represent the end of all flows in an activity.
The flow final symbol should be placed at the end of a single
activity flow.
• Condition text - Placed next to a decision marker to let you know
under what condition an activity flow should split off in that
direction
• End symbol - Marks the end state of an activity and represents the
completion of all flows of a process.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 66

Prepared By MR.EBIN PM (AP) , IESCE 33


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

Activity diagram - a login page

Prepared By Mr. EBIN P.M , AP CSE,IESCE 67

Activity Diagram -
Banking system.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 68

Prepared By MR.EBIN PM (AP) , IESCE 34


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

STATE CHART DIAGRAM


• State chart diagram is used to capture the dynamic aspect of a
system
• An object goes through various states during its lifespan. The
lifespan of an object remains until the program is terminated. The
object goes from multiple states depending upon the event that
occurs within the object.
• Each state represents some unique information about the object.
• State chart diagram visualizes the flow of execution from one
state to another state of an object.
• It represents the state of an object from the creation of an object
until the object is destroyed or terminated.
Prepared By Mr. EBIN P.M , AP CSE,IESCE 69

• The primary purpose of a state chart diagram is to model


interactive systems and define each and every state of an object.
• State chart diagrams are also referred to as State machines and
state diagrams.
• A state machine consists of states, linked by transitions. A state is
a condition of an object in which it performs some activity or
waits for an event
Simple State Machine Diagram Notation

Prepared By Mr. EBIN P.M , AP CSE,IESCE 70

Prepared By MR.EBIN PM (AP) , IESCE 35


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

Notation and Symbol for State Machine / State Chart Diagram

Prepared By Mr. EBIN P.M , AP CSE,IESCE 71

• Initial state - The initial state symbol is used to indicate the


beginning of a state machine diagram.
• Final state - This symbol is used to indicate the end of a state
machine diagram.
• Decision box - It contains a condition. Depending upon the result
of an evaluated guard condition, a new path is taken for program
execution.
• Transition - A transition is a change in one state into another
state which is occurred because of some event. A transition
causes a change in the state of an object.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 72

Prepared By MR.EBIN PM (AP) , IESCE 36


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

• State box
States represent situations during the life of an object.
It is denoted using a rectangle with round corners.
The name of a state is written inside the rounded rectangle.
 A state can be either active or inactive.
When a state is in the working mode, it is active, as soon as it
stops executing and transits into another state, the previous state
becomes inactive, and the current state becomes active.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 73

Types of State
Simple state
• They do not have any sub state.
Composite state
• These types of states can have one or more than one sub state.
• A composite state with two or more sub states is called an
orthogonal state.
Submachine state
• These states are semantically equal to the composite states
• Unlike the composite state, we can reuse the submachine states.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 74

Prepared By MR.EBIN PM (AP) , IESCE 37


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

University state
Diagram

• The composite state “Enrollment” is made up of various sub states


that will lead students through the enrollment process.
• Once the student has enrolled, they will proceed to “Being taught”
and finally to “Final exams.”

Prepared By Mr. EBIN P.M , AP CSE,IESCE 75

Eg: state chart diagram


user authentication process.

Prepared By Mr. EBIN P.M , AP CSE,IESCE 76

Prepared By MR.EBIN PM (AP) , IESCE 38


OOP using JAVA http://www.youtube.com/c/EDULINEFORCSE
STUDENTS

State machine vs. Flowchart

Prepared By Mr. EBIN P.M , AP CSE,IESCE 77

Prepared By MR.EBIN PM (AP) , IESCE 39

You might also like