[go: up one dir, main page]

0% found this document useful (0 votes)
2 views19 pages

3 Oop

The document provides an overview of Object-Oriented Programming (OOP), detailing its evolution from the early 1960s with the development of languages like Simula and Smalltalk to its dominance in the programming landscape today. Key concepts of OOP such as classes, objects, abstraction, encapsulation, inheritance, and polymorphism are explained, emphasizing their advantages in creating modular and maintainable code. The document highlights how OOP allows programmers to focus on the interactions between objects rather than just the operations performed on data.

Uploaded by

ginefedigamon123
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)
2 views19 pages

3 Oop

The document provides an overview of Object-Oriented Programming (OOP), detailing its evolution from the early 1960s with the development of languages like Simula and Smalltalk to its dominance in the programming landscape today. Key concepts of OOP such as classes, objects, abstraction, encapsulation, inheritance, and polymorphism are explained, emphasizing their advantages in creating modular and maintainable code. The document highlights how OOP allows programmers to focus on the interactions between objects rather than just the operations performed on data.

Uploaded by

ginefedigamon123
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/ 19

Integrative Programming & Technologies

[Midterm Period]

Object-Oriented
Programming

Prepared by:

Dahlia S. de Mesa
BSCOE, MBA, MIT
Introduction

 Object-oriented programming (OOP) is a programming paradigm


that uses objects and their interactions to design applications
and computer programs.

 Extension of procedural programming, breaks down a


programming task into a series of interactions among different
entities or objects

 It is one of the most popular programming paradigms today, and


is used in a wide variety of languages, including Java, Python,
C++, and C#.
Introduction

 Early 1960s, when computer scientists Ole-Johan Dahl and


Kristen Nygaard developed the Simula language.

 Simula was the first language to support all of the key features of
OOP, including classes, objects, inheritance, and polymorphism.

 In the 1970s, Alan Kay and his team at Xerox PARC developed the
Smalltalk language.
Introduction

 Smalltalk was a pure object-oriented language, meaning that


everything in Smalltalk, including numbers and functions, was an
object.

 Smalltalk also introduced a number of new concepts to OOP, such


as dynamic typing, garbage collection, and graphical user
interfaces.
Introduction
 OOP began to gain popularity in the 1980s and 1990s, with the
development of languages such as C++, Java, and Python.

 These languages made OOP more accessible to a wider range of


programmers, and it quickly became the dominant programming
paradigm.
Object-Oriented Programming
 Type of programming in which programmers define not only
the data structures, but also the types of operations (methods)
that can be applied to the data structure

 Enables programmers to create modules that do not need to


be changed when a new type of object is added

 Instead of focusing on what the system has to do, focus on:


 what objects the system contains
 how they interact towards solving the programming
problem
Object-Oriented Programming
 Advantages of OOP over conventional approaches:
 It provides a clear modular structure for programs which
makes it good for defining abstract data types where
implementation details are hidden and the unit has a clearly
defined interface.
 It makes it easy to maintain and modify existing code as new
objects can be created with small differences from existing
ones.
 It provides a good framework for code libraries where
supplied software components can be easily adapted and
modified by the programmer. This is particularly useful for
developing graphical user interfaces.
Object-Oriented Programming
 Illustration
Object-Oriented Programming

 Key OOP concepts:


 Objects
 Classes
 Abstraction
 Inheritance
 Encapsulation
 Polymorphism
Key OOP Concepts
 Classes
 term that describes a group or collection of objects with
common properties
 define a type of object
 specifies methods and data that type of object has
 example:
 Employee
 Car
Key OOP Concepts
 Objects
 represent “things” from the real world
 made up of
 attributes – characteristics that define an object
 methods – self-contained block of program code similar
to procedure
 example:
 a car’s attributes are make, model, year, and purchase
price
 a car’s methods are forward and backward
Key OOP Concepts

 Abstraction
 allows a programmer to hide all but the relevant
information (to the problem at hand) about an object in
order to reduce complexity and increase efficiency
 closely related to encapsulation and information hiding
Key OOP Concepts
 Encapsulation
 refers to the hiding of data (attributes) and methods within an
object
 protects an object’s data from corruption
 protects the object’s data from arbitrary and unintended use
 hides the details of an object’s internal implementation from the
users of an object
 separates how an object behaves from how it is implemented
 easier to modify programs since one object type is modified at a
time
Encapsulation

 Illustration
Key OOP Concepts

 Inheritance
 the process by which objects can acquire (inherit) the
properties of objects of other class

 provides reusability, like adding additional features to an


existing class without modifying it
Inheritance

Student
Key OOP Concepts

 Polymorphism
 refers to the ability to process objects differently
depending on their data type or class

 the ability to redefine methods for derived classes

 request for an operation can be made without knowing


which specific method should be invoked
Polymorphism

 Illustration

Application Student
Form
s.isRegistered()

c.isRegistered()

Car
Bravo Baste!

You might also like