0% found this document useful (0 votes)
15 views

Introduction To OOP

Uploaded by

Lounnaci Hassina
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Introduction To OOP

Uploaded by

Lounnaci Hassina
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Introduction to Object Oriented

Programming

• Basic concepts of object-oriented programming.


• Notions of classes, objects/instances, sending messages, and
the decomposition of a problem into these terms.
• Polymorphism.
• Inheritance.
• Abstraction of the problem representation.
• Learn to program in Java.

DR. YOUSSEF ELMIR [email protected]


Introduction to Object Oriented Programming
2

 To solve a problem, one must:


 Understand and analyse the problem.

 Design a solution.

 Implement the solution (program).

 Test the solution.

 This should be done considering:


 Maintenance

 Evolution

 Software reuse

Dr. Youssef Elmir [email protected]


Programming paradigms
3

 A paradigm is a "theoretical model of thought that


guides scientific research and reflection" (Larousse).

 A programming paradigm is a cognitive tool that


guides the way of analysing, designing, and coding a
program. There are four main programming
paradigms:
 Procedural: Fortran, C, Pascal, ...
 Functional: LISP, Scheme, Haskell...
 Logic: Prolog, GHC...
 Object-Oriented: Simula, Smalltalk, C++, Java, C#

Dr. Youssef Elmir [email protected]


Programming Object Oriented (OOP)
4

 Object-Oriented Programming (OOP) is an


implementation method in which programs are
organized as cooperative collections of objects.
Each object represents an instance of a specific
class, and all classes are members of a class
hierarchy connected through inheritance
relationships.

Dr. Youssef Elmir [email protected]


Procedural Vs Object Oriented
5

 In procedural programming,

 One learns to break down a problem into a series of simple


steps (functions) to solve it.

 First, one decides how to manipulate the data, then the type of
data structure that is most suitable to facilitate this
manipulation.

 Results in software that is difficult to maintain and reuse.

Dr. Youssef Elmir [email protected]


Procedural Vs Object Oriented
6

 In Object-Oriented Programming (OOP),

 A computer program is considered as a collection of


objects working together to perform a task.

 One focuses on data first, before determining the


algorithm that will be used to operate on this data.

 Objects collaborate through the sending of messages


(method calls).

Dr. Youssef Elmir [email protected]


Procedural Vs Object Oriented
7

 In procedural programming

Dr. Youssef Elmir [email protected]


Procedural Vs Object Oriented
8

 In object-oriented programming

Dr. Youssef Elmir [email protected]


Procedural Vs Object Oriented
9

Procedural Object Oriented


What should this program What are the entities of this
do? program?
Which procedures do I need? What are the fundamental
objects of the application?

Dr. Youssef Elmir [email protected]


What is This than an object?
10

 Object-oriented programming is based on the notion


of object

 In the real world, an object can be:

A car,
 Library,
 A teacher
 A book
…

Dr. Youssef Elmir [email protected]


What is This than an object?
11

 In the real world, objects have attributes and


behaviors:

 Object, attributes, behaviors


A car, accelerator, accelerates
 A library, subscribers, lends books
 A teacher, lessons, teaches
 A computer, processor, calculates

Data + Procedures

Dr. Youssef Elmir [email protected]


What is This than an object?
12

 Object-oriented programming systematizes


modularity and enables the reuse of software
components.

Dr. Youssef Elmir [email protected]


The reasons for the success of OOP
13

 Based on a solid software engineering approach;

 Mastery of the complexity of large software systems;

 Consolidated by object-oriented methods and the standard


(UML) they use as an object modeling language;

 Its foundations facilitate distributed programming.

Dr. Youssef Elmir [email protected]


Why java?
14

 Java is object-oriented (uses classes and basic types).


 Java is easy to learn (its syntax is similar to that of
C/C++).
 Java is portable (platform-independent).
 Java is reliable (strong data typing and no apparent
pointers).
 Java is secure (exception mechanism, runtime code
verification, and control of network and/or file access).
 Java provides memory management (Garbage Collector).

Dr. Youssef Elmir [email protected]

You might also like