Presentation is loading. Please wait.

Presentation is loading. Please wait.

Basic Object Oriented Approach

Similar presentations


Presentation on theme: "Basic Object Oriented Approach"— Presentation transcript:

1 Basic Object Oriented Approach
Shaik Khaja Hussain, Assistant Professor in Computer Science

2 SHAIK KHAJA HUSSAIN Basic Object Oriented Approach
Object Oriented Programming Computer Science 2nd Semester - M.Sc.(Computer Science) National P.G. College – Rayalaseema University, Kurnool

3 Session Objectives Discuss the programming Paradigms
Discuss the Object Oriented Approach Discuss basic Object-Oriented concepts Object Class Encapsulation Abstraction Polymorphism Inheritance

4 Programming Paradigms
Unstructured Programming Procedural Programming Structural Programming Object Oriented Programming

5 Unstructured Programming
In this whole problem is solved as a single block. All the data are global and there is no security. To share the codes jumps are allowed and so contain lot of goto statements. This is suitable only for small problem. Difficult to follow and correct errors Eg, Assembly Language, BASIC.

6 Procedural Programming
Program is divided in to a number of sub programs. Reusability of procedures/functions. The program has global and local variables.

7 Structural Programming
The program is divided into modules and the modules are then divided into functions. Each module can work independent of one another.

8 Object Oriented Programming
The Program is divided into number of small units called Object. The data and function are build around these objects. The data of the objects can be accessed only by the methods associated with that object. The methods of one object can access the methods of other object.

9 The Object-Oriented Approach
The object-oriented approach is quite comparable to the way a human solves daily problems. The approach consists of identifying objects and how to use these objects in the appropriate order to solve the problem. There are four steps in the object oriented methodology. They are Identify the problem. Identify the objects needed for the solution. Identify the messages to be sent to the objects. Create a sequence of messages to the objects that solve problem.

10 Object – Oriented Programming
Here the application has to implement the entities as they are seen in real life and associate their actions and attributes with each other. Accounts Functions Calculate salary Pay salary Pay bills Tally accounts Transact with banks Data Employee details Salary statements Bills Vouchers Receipts

11 Objects An object is a concept or thing with defined boundaries that is relevant to the problem we are dealing with. Some real-life entities : Physical Objects Vehicles in a traffic -monitoring application Electrical components in a circuit design problem Elements of the computer-user environment Windows Menus

12 Objects (contd…) Objects should have two things Model : Ferrari
Properties Behaviour Model : Ferrari Color : Red Year : 1995 Actions Start Stop Accelerate

13 Classes A class is a group of objects that have the same properties, common behavior. Polygon objects Polygon class Properties Vertices Border color Fill color Methods Draw Erase Move

14 Encapsulation The wrapping up of data and methods into a single unit is called as Encapsulation. Encapsulation is a process that allows selective hiding of properties and methods in a class. Attributes methods Class

15 Abstraction Abstraction is the process of hiding the details and exposing only the essential features of a particular concept or object. Class Data Abstraction Procedural Abstraction private Data/methods Not accessible from outside class public Data/methods Accessible from outside class

16 Polymorphism Polymorphism allows same method to behave differently on different classes. Allows one interface to be used for general class of actions Sub classes Class : Shape Methods : Draw Move Initialize

17 Inheritance Inheritance is the property that allows the reuse of an existing class to build a new class Objects of one class acquire the properties of objects of another class Provides the idea of reusability Animals

18 Reusability Make sounds Eat and drink Felines Hunt prey Roar Mew
Eat flesh Hunt big game Mew Drink milk Hunt mice

19 Object – Oriented Languages
Small Talk Eiffel CLOS Java


Download ppt "Basic Object Oriented Approach"

Similar presentations


Ads by Google