this slides describe similarities and difference between object based programming and object oriented programming
Class and Object.
Object- oriented Programming
Object based Programming
Object based vs. object-oriented programming
2. 2
Object-Oriented Vs. Object based
Programming
Id Name
1109025 Partha Chakrabarty
1109026 Md. Mujibur Rahman Majumder
1109028 Md. Natik Alam Bhuyan Tahsin
1109031 Md. Al Fahad
1109032 Md. Rashedul Islam
Presented By :
4. Overview
4
What is a Class?
What is a Object?
What is an Object-Oriented Programming?
Requirements of Object-Oriented language.
What is an Object Based Programming?
Why we use object based instead of object oriented programming?
Difference between Object based and Object-Oriented Programming?
5. What is a Class?
5
A class can be defined as a template/blueprint that describes the
state or behavior of objects of certain kinds.
Class Contain Properties and Function.
Example : Student , Animal, Car etc.
6. What is an Object?
6
Object refers to a particular instance of a class where the object can
be a combination of variables, functions, and data structures.
An object consists of data of its own.
9. Object-Oriented Programming
9
The basic idea behind an Object Oriented Programming
language is to combine into a single unit both data and the
methods (functions) that operate on the data.
Some of the popular OOP languages are -
C++
Java
C#
10. Requirements for OOP
10
To be object oriented, a language must support
Encapsulation
Inheritance
Polymorphism
11. Encapsulation
11
The whole idea behind the data encapsulation is to hide the
implementation details from users. This is achieved through the state
(the private fields) and the behaviors (the public methods) of a Class.
Often, for practical reasons, an object may wish to expose some of its
variables or hide some of its methods.
Encapsulation uses three common types of modifier to encapsulate
data.
Public
Private
Protected
12. Inheritance
12
Inheritance is a fundamental feature of an Object-Oriented
programming. It is the process of creating a new Class, called the
Derived Class, from the existing class, called the Base Class
Inheritance is a very elegant way to reuse and modify the data and
functionality that has already been defined in the Base Class, also we
can add new data and functionality to the Derived Class.
13. Inheritance Contd.
13
Since the Derived Class inherits all properties of the Base Class, the
Derived Class has a larger set of properties than the Base Class.
However, the Derived Class may override some or all the properties of
the Base Class.
14. Types of Inheritance
14
A
B
C
A B
C
A-1
A-2
B-1
B-2
AB
Multi-level Inheritance
Multiple Inheritance
Multiple Multi-level Inheritance
15. Polymorphism
15
The ability to appear in many forms.
In object-oriented programming, polymorphism refers to a
programming language's ability to process objects differently
depending on their data type or class.
Polymorphism allows us to invoke derived class methods through a
base class reference during runtime.
E.g. e-bike Acceleration system.
Electronically / Mechanically
17. Object Based Programming
17
Object Based Programming is based on the idea of encapsulating
state and operations inside “objects”.
Object-based languages need not support inheritance or
polymorphism . While Object oriented language support all
feature of OOPS i.e. Inheritance, polymorphism etc.
Object Based Language Build in type object are available like
window object in JavaScript .
Example: JavaScript, VB
18. Why we use Object based instead of OOP
18
The main benefit of Object based Programming is that
it can be understood by the common human.
Object Based is much easier and more robust than
Object Oriented.
It allows for fast creation of web page events.
It allows more freedom in the creation of objects.
http://www.htmlgoodies.com/beyond/javascript/article.php/3470971
19. Drawbacks of object based programming
19
Object based programming is less secure. Because the
code executes on the user’s computer, in some cases it
can be exploited for malicious purposes.
Object based programming sometimes interpreted
differently by different browsers.
http://www.htmlgoodies.com/beyond/javascript/article.php/3470971
20. Object based Programming Object oriented Programming
Object-based language doesn't
support all the features of
OOPs like Polymorphism and
Inheritance.
Object-based language has
built-in object like JavaScript
has window object.
Examples : JavaScript, VB etc.
Object-oriented language
supports all the features of
OOPs
.
Object-oriented language
doesn't have built-in object.
Examples : C++, C#, Java etc.
20
Object based vs. Object-oriented programming
21. Conclusion
21
From the above discussion, we clearly understand about the
difference between Object Based and Object Oriented
Programming and also when we use Object based instead of
Object Oriented Programming.