100% found this document useful (1 vote)
41 views15 pages

L1 Intro To OOP

Uploaded by

9923103241
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
41 views15 pages

L1 Intro To OOP

Uploaded by

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

SOFTWARE DEVELOPMENT FUNDAMENTALS-2

Introduction to object oriented programming

Lecture 1
Course Outcome
The following are expected outcomes from the students after the completion of this course,

Outcomes Cognitive level


CO1 Explain various object oriented concepts like class and objects, Understand level
friend function, function and operator overloading etc. (Level-2)
CO2 Apply and implement the relationships of association, Apply level (Level-3)
aggregation, composition and inheritance
CO3 Apply SQL commands to create tables and perform various Apply level (Level-3)
operations like insert, delete, select etc.
CO4 Analyze the output of source code and able to debug the errors Analyze level (Level-4)
CO5 Design the class diagram for real life problems and implement it Create level (Level-6)
using virtual functions, abstract classes, templates and exception
handling.

2
Assessment method
External Assessment –
◦ T1 – 20 Marks
◦ T2 – 20 Marks
◦ End Semester Exam – 35 Marks

◦ Internal Assessment : 25 Marks

3
C Vs C++
C is a structural or procedural programming language that was used
for system applications and low-level programming applications.
C++ is an object-oriented programming language having some
additional features like Encapsulation, Data Hiding, Data Abstraction,
Inheritance, Polymorphism, etc. This helps to make a complex project
more secure and flexible

The unit in procedural programming is function, and unit in object-


oriented programming is class
Procedural vs. Object-Oriented
Programming

Procedural programming concentrates on creating functions, while


object-oriented programming starts from isolating the classes, and
then look for the methods inside them.

Procedural programming separates the data of the program from


the operations that manipulate the data, while object-oriented
programming focus on both of them
Procedural vs Object Oriented
Procedural programming Object oriented programming
Divided into primitive entities called as
Divided into primitive entities called as
functions. objects.
It gives preference to functions over It gives preference to data over
data. functions.
It doesn’t support data hiding, It supports data hiding, polymorphism
polymorphism and exception handling. and exception handling.
It doesn’t have access specifiers. It has access specifiers such as private,
public and protected.
Inclusion of new function and data is Inclusion of new function and data is
cumbersome. easier.
Example: C Example: C++, JAVA, Python
C++ (Object Oriented
Programming Language)
 C++ is one of the oldest programming languages.
 Bjarne Stroustrup invented it in 1979 in New Jersey at
Bell laboratories.
 Earlier, C++ is an extension of the C language.
 In 1982 novel features were introduced like operator
overloading, virtual functions, comments, and so on.
 In 1985 C++ was released for commercial
implementation, and in the year 1989, its second edition
was released
Introduction to object oriented
programming
• Object oriented programming emphasizes more on data than procedures.

• Each program is represented using objects.

• An object communicates with another object through functions.

• Data is hidden and protected from external functions. Object B

• It has following characteristics,


• Data Encapsulation
Object A
• Data hiding
• Data abstraction
• Inheritance Object C
• Polymorphism
Introduction to object oriented
programming
▪ Data Encapsulation binds data with its corresponding functions.

▪ Only those functions which are encapsulated together can access the data.
▪ These bounded functions acts like an interface that allows access to the data
for any program.
▪ By restricting the access to data, it provides data hiding from external
program.
Class A
Data
Functions
Introduction to object oriented
programming
▪ Data Abstraction shows only relevant information about the objects instead of
the entire background details.
▪ It separates the interface from its implementation.
▪ Classes are used to implement abstraction and they are called as abstract data
types (ADT).
▪ For example, the function cout is used as a interface to display on the console
and the internal implementation is not revealed to the outside world.
Introduction to object oriented
programming
▪ Inheritance is a way to include functionalities of a parent class to a child class.
▪ It doesn’t allow inheritance of private members from parent class.
▪ It enhances code reusability. Class A
Data
Functions

Class B
Data
Functions
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.
Introduction to object oriented
programming
▪ Polymorphism enables to define many forms of a function and it is
invoked based on the object calling it.
▪ The functionality of a function differs according to the object that
calls it.
Class A
▪ Inheritance helps to implement polymorphism.
Data
Functions

Class B
Data
Functions
Benefits of object oriented
programming
▪ Data hiding helps to protect the data and it secures the programs.
▪ Exception handling can be performed using OOP.
▪ Program templates can be developed and used in future applications.
▪ Programs can be easily upgraded and portable.
▪ Reduces redundant codes and improves code reusability.
▪ Improves productivity by saving development time.
References
▪Herbert Schildt, “C++: The complete reference”, Mc Graw Hill Osborne media, 4th edition, 2017

▪Robert Lafore, “Object oriented programming in C++”, SAMS, 4th edition, 2002

15

You might also like