Module 1 Chapter-1
Module 1 Chapter-1
com/c/EDULINEFORCSE
STUDENTS
MODULE 1- INTRODUCTION
CHAPTER – 1
Approaches to Software Design
Prepared By Mr. EBIN P.M , AP CSE,IESCE 1
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
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
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.
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
Fig: polymorphism
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.
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.
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
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
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.
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
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
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
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.
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.
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.
Messages used
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.
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.
Activity Diagram -
Banking system.
• 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.
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.
University state
Diagram