Presentation is loading. Please wait.

Presentation is loading. Please wait.

Object Oriented Programming

Similar presentations


Presentation on theme: "Object Oriented Programming"— Presentation transcript:

1 Object Oriented Programming
Abd El-Aziz Ahmed Abd El-Aziz Assistant Professor Institute of Statistical Studies and Research, Dept. of Computer and Information Sciences, Cairo University

2 Lecture 1 Introduction to Object Oriented Programming
The programming methodologies are : Procedural programming. Object-Oriented programming (OOP).

3 Lecture 1(Cont.) Introduction to Object Oriented Programming
Procedural programming: The languages use the procedural programming include Pascal and C languages. Involves dividing a large program into a set of modules to perform specific tasks. Module consists of single or multiple procedures. Procedures are also known as functions, routines, subroutines, or methods in various programming languages. In a program following procedural methodology, each step of a subprogram is linked to the previous step.

4 Lecture 1(Cont.) Introduction to Object Oriented Programming
Procedural programming:

5 Lecture 1(Cont.) Introduction to Object Oriented Programming
Procedural programming: The benefits are: Easy to read program code. Easy to manipulate code as a various procedures. Code is more flexible as you can change the procedures.

6 Lecture 1(Cont.) Introduction to Object Oriented Programming
Procedural programming: The features of procedural programming methodology are : Large program are divided into smaller programs. Most of the data are shared as global that can accessed from any where within the program. The procedures are interdependent that can’t be reused in different applications.

7 Lecture 1(Cont.) Introduction to Object Oriented Programming
Procedural programming: The procedural language’s limitations are: The functions are interdependent, therefore, it’s difficult to separate one from another. They can’t be reused in other programs. The data are visible and accessible, making it easy to manipulate the data from anywhere in the program.

8 Lecture 1(Cont.) Introduction to Object Oriented Programming
Object- Oriented Programming (OOP) In this methodology, the large application is broken into independent components called objects, which can be integrated to create a complete program. The advantages of Object-Oriented programming are: Real world programming. Reusability of code. Modularity of code. Resilience to change(المرونة). Information hiding.

9 Lecture 1(Cont.) Introduction to Object Oriented Programming
Object- Oriented Programming (OOP) Real world programming: The object-oriented approach models the real world more accurately than the conventional, procedural approach. Reusability of code: In the object-oriented approach, you build classes, which can be used by several applications. Modularity of code: An object can be maintained independently of other objects. Resilience to change: Object-oriented programming also enables you to evolve various versions of software. When a change is suggested, the old system need not be completely re-built from scratch.

10 Lecture 1(Cont.) Introduction to Object Oriented Programming
Object- Oriented Programming (OOP) Information hiding: Information hiding ensures data security in a program. Identifying the Applications of Object-Oriented Programming: Character User Interface (CUI) based Applications: is an interface used to interact with a computer by typing commands on the command-line. CUI is not user-friendly because a user needs to remember all the commands and the syntax of the commands. Graphical User Interface (GUI) based Applications: GUI is a method of interacting with a computer by directly manipulating graphical images in addition to text.

11 Lecture 1(Cont.) Introduction to Object Oriented Programming
Object- Oriented Programming (OOP) Identifying the Applications of Object-Oriented Programming: Computer Aided Designing/Manufacturing (CAD/CAM) :Concept of OOP is used to create graphical and numerical building blocks that can be assembled to form portable, flexible, and cost effective solutions for various real life problems.

12 Lecture 1(Cont.) Introduction to Object Oriented Programming
Object- Oriented Programming (OOP): Classes and Objects: A class is the blueprint of objects. A class defines the structure and behaviors of an object or a set of objects. A class is a collection of various attributes and methods. Objects are the basic building of OOP. An object is an instance of a class. You can access the data of a class by using its methods.

13 Lecture 1(Cont.) Introduction to Object Oriented Programming
Object- Oriented Programming (OOP): Classes and Objects: Objects display the following characteristics: State: is indicated by a set of attributes and the values of these attributes. Behavior: refers to a change of the state over a period of time. It is how an object acts and reacts, in terms of its state changes. Identity: each object has a unique identity. The state and behavior comprise the properties of an object. The objects of the same class have the same behavior (methods), may or may not have the same state, but will never have the same identity.

14 Lecture 1(Cont.) Introduction to Object Oriented Programming
Features of Object- Oriented Programming : Encapsulation. Inheritance . Polymorphism .

15 Lecture 1(Cont.) Introduction to Object Oriented Programming
Features of Object- Oriented Programming : Encapsulation: is the process of hiding all of the details of an object that do not contribute to its essential characteristics. Encapsulation is the feature that provides security to the data as well as the methods of a class.

16 Lecture 1(Cont.) Introduction to Object Oriented Programming
Features of Object- Oriented Programming : Inheritance: Enables you to extend the functionality of an existing class. Enables you to add new features and functionality to an existing class without modifying the existing class. Enables you to share data and methods among multiple classes. Superclass and Subclass : A superclass or parent class is the one from which another class inherits attributes and behavior. A subclass or child class is a class that inherits attributes and behavior from a superclass.

17 Lecture 1(Cont.) Introduction to Object Oriented Programming
Features of Object- Oriented Programming :

18 Lecture 1(Cont.) Introduction to Object Oriented Programming
Features of Object- Oriented Programming : Relationships Between Classes Kind-of relationship. Is-A relationship. Part-of relationship. Has-A relationship.

19 Lecture 1(Cont.) Introduction to Object Oriented Programming
Features of Object- Oriented Programming : Kind of relationship: the kind-of relationship is used at the class level to describe the relationship between a superclass and a subclass. A subclass is a kind-of the superclass. Confirmed Ticket Kind-of

20 Lecture 1(Cont.) Introduction to Object Oriented Programming
Features of Object- Oriented Programming : Is-A relationship: it’s used at the instance level to describe the relationship between an instance (object) and a class. Ticket for New York Confirmed Ticket Is-A Kind of

21 Lecture 1(Cont.) Introduction to Object Oriented Programming
Features of Object- Oriented Programming : Part-of relationship: when a class is an element of another class, it depicts the part-of relationship. Address Student Part of

22 Lecture 1(Cont.) Introduction to Object Oriented Programming
Features of Object- Oriented Programming : Has-A relationship: it’s the reverse of part-of relationship. When a class consists of another class, it depicts the has-a relationship. The has-a relationship is known as aggregation or composition. Student Detail Address Has-a

23 Lecture 1(Cont.) Introduction to Object Oriented Programming
Features of Object- Oriented Programming : Types of Inheritance: Single inheritance Multiple inheritance

24 Lecture 1(Cont.) Introduction to Object Oriented Programming
Features of Object- Oriented Programming : Single Inheritance: a subclass is derived from only one superclass.

25 Lecture 1(Cont.) Introduction to Object Oriented Programming
Features of Object- Oriented Programming : Multiple Inheritance: a subclass is derived from more than one superclass.


Download ppt "Object Oriented Programming"

Similar presentations


Ads by Google