Lecture 1-2

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Object Oriented Analysis & Design (OOAD) Lecture 1 & 2

Software

A program is an executable code, which serves some computational purpose.

Software is more than just a program code. Software is considered to be a collection of executable
programming code, associated libraries and documentations. Like the ‘VLC player’ example we discussed
in the class. Software, when made for a specific requirement is called software product.

Software Development Life Cycle (SDLC)

The Software Development Lifecycle is a systematic process for building software that ensures the
quality and correctness of the software built. SDLC process aims to produce high-quality software which
meets customer expectations. The software development should be complete in the pre-defined time
frame and cost.

SDLC consists of a detailed plan which explains how to plan, build, and maintain specific software. Every
phase of the SDLC lifecycle has its own process and deliverables that feed into the next phase.

SDLC Phases: SDLC has defined its phases as, Requirement gathering, Designing, Coding, Testing, and
Maintenance. It is important to adhere to the phases to provide the Product in a systematic manner.

 Requirement gathering and analysis


 Design
 Implementation or coding
 Testing
 Deployment
 Maintenance

1) Requirement Gathering and Analysis: During this phase, all the relevant information is collected from
the customer to develop a product as per their expectation. Any ambiguities must be resolved in this
phase only. Business analyst and Project Manager set up a meeting with the customer to gather all the
information like what the customer wants to build, who will be the end-user, what is the purpose of the
product. Before building a product a core understanding or knowledge of the product is very important.

For Example, A customer wants to have an application which involves money transactions. In this case,
the requirement has to be clear like what kind of transactions will be done, how it will be done, in which
currency it will be done, etc.

Once the requirement gathering is done, an analysis is done to check the feasibility of the development
of a product. The requirements which are unrealistic cannot be implemented or those who cannot be
tested are removed from the system. In case of any ambiguity, a call is set up for further discussion.

Once the requirement is clearly understood, the SRS (Software Requirement Specification) document is
created. This document should be thoroughly understood by the developers and also should be
reviewed by the customer for future reference.

Fall - 2019
Object Oriented Analysis & Design (OOAD) Lecture 1 & 2

2) Design: In this phase, the requirement gathered in the SRS document is used as an input and software
architecture that is used for implementing system development is derived.

3) Implementation or Coding: Implementation/Coding starts once the developer gets the Design
document. The Software design is translated into source code. All the components of the software are
implemented in this phase.

4) Testing: Testing starts once the coding is complete and the modules are released for testing. In this
phase, the developed software is tested thoroughly and any defects found are assigned to developers to
get them fixed. Retesting, regression testing is done until the point at which the software is as per the
customer’s expectation. Testers refer SRS document to make sure that the software is as per the
customer’s standard.

5) Deployment: Once the product is tested, it is deployed in the production environment or first UAT
(User Acceptance testing) is done depending on the customer expectation. In the case of UAT, a replica
of the production environment is created and the customer along with the developers does the testing.
If the customer finds the application as expected, then sign off is provided by the customer to go live.

6) Maintenance: After the deployment of a product on the production environment, maintenance of the
product i.e. if any issue comes up and needs to be fixed or any enhancement is to be done is taken care
of by the developers.

Supporting activities /Umbrella Activities: There are also supporting activities such as configuration
and change management, quality assurance, project management, user experience, project tracking and
control. These processes are performed no matter which SDLC is followed.

SDLC model/processes

Some Popular SDLC models are: Waterfall model, Incremental Approach, Agile Model, Spiral Model, V-
Model, Prototyping model, Iterative model etc. Depending on the project characteristics (complexity,
availability of all the requirements and project plan before starting the project, intensity of risk,
frequency of change etc.), the software process is selected accordingly. We have discussed this point in
class twice or thrice.

Software process for object-oriented development: For object oriented development of the software
system, Rational Unified Process (RUP) is selected along with a visual modeling tool that is Unified
Modeling Language (UML).

Now let’s shed some light on the “OO” part of the OOAD and revise some important concepts.

The Object Oriented Paradigm (style of programming): The object-oriented paradigm encapsulates
data (properties/attributes) and the procedures (operations/methods) that may access and operate on
that data into an entity called an object. A group of similar objects are described by a class and these

Fall - 2019
Object Oriented Analysis & Design (OOAD) Lecture 1 & 2

objects interact with each other by sending messages/invoking functions. The entire object oriented
software project can be seen as a collection of objects interacting with each other.

UML – Unified Modeling Language: These OO concepts (class, object, inheritance, interface, association
etc.) are modeled into a diagram for the developer for coding purposes later on. These diagrams are a
graphical notation for the ease of understanding of everyone involved in the project. Such a graphical
notation is provided by UML – Unified Modeling Language.

UML 2.0 has 14 such diagrams and they visually model different aspects of the system such as classes,
objects and components, class/object association and how one object of the class interacts with the
object of another class.

Before going in to the detail, the design modeling diagrams are of two types; structural and behavioral.
Structural diagrams give a static physical snapshot of the system and represent those parts – interfaces,
objects, components and nodes, which make up the system. Behavioural diagrams, on the other hand,
represent the dynamic picture of the system that represents system’s actual dynamic flow (of control)
and functionality.

Structural Behavioural
Diagrams Diagrams

Interaction
Block Diagram
Diagram

Sequence Diagram
Class Diagram
• Diagram
Collaboration Diagram

Object
Diagram
State Chart
Diagram
Component
Diagram
State
Transition
Deployment Diagram
Diagram

Key OO concepts: Some key object oriented concepts are: class, object, encapsulation, inheritance,
abstraction, polymorphism and data hiding.

Fall - 2019
Object Oriented Analysis & Design (OOAD) Lecture 1 & 2

Class: The building block of C++ that leads to Object Oriented programming is a Class. It is a user
defined data type, which holds its own data members and member functions, which can be
accessed and used by creating an instance of that class. A class is like a blueprint for an object.
For Example, consider the Class of Cars. There may be many cars with different names and
brand but all of them will share some common properties like all of them will have 4 wheels,
Speed Limit, Mileage range etc. So here, Car is the class and wheels, speed limits, mileage are
their properties.

 A Class is a user defined data-type which has data members and member functions.

 Data members are the data variables and member functions are the functions used to
manipulate these variables and together these data members and member functions
defines the properties and behavior of the objects in a Class. In the above example of
class Car, the data member will be speed limit, mileage etc. and member functions can
be apply brakes, increase speed etc.

Object: An object is an instance of a Class. When a class is defined, no memory is allocated but
when it is instantiated (i.e. an object is created) memory is allocated.

Constructor: Constructors are special class members which are called by the compiler every
time an object of that class is instantiated. Constructors are special class members which are
called by the compiler every time an object of that class is instantiated.

Destructor: Destructor is another special member function that is called by the compiler when
the scope of the object ends.

Data Hiding: Data hiding is a technique specifically used in object-oriented programming (OOP)
to hide internal object details (data members). Data hiding ensures exclusive data access to
class members and this can be achieved by defining access modifiers. Access modifiers are
public, private and protected.

Fall - 2019
Object Oriented Analysis & Design (OOAD) Lecture 1 & 2

Inheritance: Considering ‘HumanBeing’ a class, which has properties like hands, legs, eyes etc.,
and functions like walk, talk, eat, see etc. ‘Male’ and ‘Female’ are also classes, but most of the
needed properties and functions are already included in ‘HumanBeing’, hence they can inherit
everything from class HumanBeing using the concept of Inheritance. A point to remember here
is ‘HumanBeing’ is a general class but ‘Male’ and ‘Female’ are specialized classes – they will
exhibit properties and functions exclusive to them and inheriting the common/general functions
from the super class.

Encapsulation: Encapsulation is about binding the data variables and functions together in a
class for the objects to use.

Polymorphism: It is a feature, which lets us create functions with same name but different
arguments, which will perform different actions. That means, functions with same name, but
functioning in different ways. Function overloading and function overriding are examples of
polymorphism.

Function overloading: Function overloading is a feature that allows us to have same


function more than once in a program. Overloaded functions have same name but their
signature (number, sequence and type of arguments) must be different.

#include <iostream>
using namespace std;
// overloaded functions
float sum(int, int);
float sum(float, float);
float sum(int, float);
float sum(float, int);
int main(){………………………………………………
sum(9,9);
sum(11.1,12.2);
sum(8, 11.1);
sum(8.9,6);
}

The function sum is declared four times with different signatures. Based on the
parameters we pass, while calling function sum, decides which method is to be called.
This happens during compilation (static polymorphism and early binding).

Function overriding: Function overriding is a feature of OOPs Programming that allows


us to override a function of parent class in child class (run-time polymorphism and late
binding).

#include<iostream>
using namespace std;
//Parent class or super class or base class
class A{
public:
void disp() {
cout<<"Parent Class disp() function"<<endl;
}
void xyz() {

Fall - 2019
Object Oriented Analysis & Design (OOAD) Lecture 1 & 2

cout<<"xyz() function of parent class";


}
};
//child class or sub class or derived class
class B : public A{ // Inheritance
public:
/* Overriding disp() function of parent class
* and giving a different definition to it.
*/
void disp() {
cout<<"Child class disp() function"<<endl;
}
};
int main(){
//Creating object of child class B
B obj;
obj.disp();
/* If you want to call the overridden function
* (the same function which is present in parent class)
* from the child class then assign the reference of
* parent class to the child class object.
*/
A obj2 = B();
obj2.disp();
}

Function Overloading happens in the same class when we declare same functions with
different signature in the same class. Function Overriding happens in the child class
when child class overrides parent class function. In function overloading function
signature should be different for all the overloaded functions. In function overriding the
signature of both the functions (overriding function (in child class) and overridden
function (in parent class)) should be same.

Abstraction: Abstraction refers to showing only the essential features of the application and
hiding the details. In C++, classes can provide methods to the outside world to access & use the
data variables, keeping the variables hidden from direct access, or classes can even declare
everything accessible to everyone, or maybe just to the classes inheriting it. This can be done
using access specifiers.

Abstract Class: An abstract class is which cannot be instantiated. It may contain constants, data
members, abstract methods (methods with no implementation or body) and defined methods.
Abstract methods start with the keyword ‘virtual’. They are virtual or pure virtual functions.
These abstract methods are implemented by the concrete class. Moreover, these data members
(if any) and abstract or non-abstract methods can be defined with any visibility (public, private
and protected).

//abstract parent class


abstract class Animal{
//abstract method
public abstract void sound();
}

Fall - 2019
Object Oriented Analysis & Design (OOAD) Lecture 1 & 2

//Dog class extends Animal class. ‘extends’ mean inheritance in code


here.
public class Dog extends Animal{
public void sound(){
System.out.println("Woof");
}
public static void main(String args[]){
Animal a= new Dog();
a.sound();
}
}

Concrete class: The class that inherits from the abstract class and provides the implementation
of all the abstract methods and can be instantiated is called a concrete class. It must implement
the abstract methods.

Interface: Interface is defined with the keyword ‘interface’ and it contains only constants and
abstract methods. All the abstract methods and constants are public. It is a contract and every
method must be implemented by the class who implements it.

public interface Brain{


public static final int number = 1;
public void talk( String name );
public abstract void doProgramming();
}

Abstract class vs. Interface: If we don't know anything about implementation just we have
requirement specification. Then we should go for interface. When we are talking about
implementation but not complete (just partial implementation) then we should go for abstract
class.

Resources:

http://icarus.cs.weber.edu/~dab/cs1410/textbook/1.Basics/models.html

https://www.tutorialspoint.com/object_oriented_analysis_design/ooad_object_oriented_paradigm.ht
m

https://www.tutorialspoint.com/object_oriented_analysis_design/ooad_object_oriented_system.htm

https://www.geeksforgeeks.org/software-engineering-object-oriented-life-cycle-model/amp/

https://www.studytonight.com/cpp/cpp-and-oops-concepts.php

https://www.geeksforgeeks.org/c-classes-and-objects/amp/

Fall - 2019

You might also like