object oriented programming(slides)

Upload: akash-khaitan

Post on 07-Apr-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 Object Oriented Programming(Slides)

    1/8

    OBJECT ORIENTEDOBJECT ORIENTED

    PROGRAMMINGPROGRAMMING

    Presentation ByPresentation ByAkash KhaitanAkash Khaitan

    08DDCS54708DDCS547

  • 8/6/2019 Object Oriented Programming(Slides)

    2/8

    INTRODUCTIONINTRODUCTION

    It is a new way of organizing and developing programs and hasIt is a new way of organizing and developing programs and hasnothing to do with any particular languagenothing to do with any particular language

    Object oriented programming allows us to decompose a problemObject oriented programming allows us to decompose a probleminto a number of entities called objects and then build data andinto a number of entities called objects and then build data and

    functionsfunctions

    It creates partitioned memory area for both data andIt creates partitioned memory area for both data and

    functions that can be used as templates for creatingfunctions that can be used as templates for creating

    copies of such modules on demand.copies of such modules on demand.

    Languages that support OOP features include C++, Object Pascal,Languages that support OOP features include C++, Object Pascal,

    Ada, JavaAda, Java

  • 8/6/2019 Object Oriented Programming(Slides)

    3/8

    Classes And ObjectsClasses And Objects

    Classes are the basic building unit in the object orientedClasses are the basic building unit in the object orientedprogramming concept that is all the required functions of aprogramming concept that is all the required functions of aparticular class type are defined in the class, which can beparticular class type are defined in the class, which can beaccessed later according to the programmers need.accessed later according to the programmers need.

    A object is instance of class that contains all the properties ofA object is instance of class that contains all the properties ofclass.class.

    To access a particular member function/method of a particularTo access a particular member function/method of a particularclass, dot operator is used.class, dot operator is used.

    A class may be thought as a data type and an object as aA class may be thought as a data type and an object as avariable of that data type.variable of that data type.

    Once a class is defined, we can create any number ofOnce a class is defined, we can create any number ofobjects belonging to same class.objects belonging to same class.

  • 8/6/2019 Object Oriented Programming(Slides)

    4/8

    ABSTRACTION &ABSTRACTION &

    ENCAPSULATIONENCAPSULATION The concept of abstraction and encapsulation relates to the idea ofThe concept of abstraction and encapsulation relates to the idea of

    hiding data that are not needed for the presentationhiding data that are not needed for the presentation

    This provides some of the declarations which decides theThis provides some of the declarations which decides theavailability of data members of a class by other classesavailability of data members of a class by other classes

    In OOP, information hiding reduces software development risk byIn OOP, information hiding reduces software development risk byshifting the code's dependency on an uncertain implementationshifting the code's dependency on an uncertain implementationonto a wellonto a well--defined interfacedefined interface

    An example of this concept can be seen in the case of bankAn example of this concept can be seen in the case of bankaccounts , orkut etcaccounts , orkut etc

  • 8/6/2019 Object Oriented Programming(Slides)

    5/8

    POLYMORPHISMPOLYMORPHISM

    Polymorphism means the ability to take more than one formPolymorphism means the ability to take more than one form

    It provides a special facility that is same function can be calledIt provides a special facility that is same function can be calledfor different purpose depending on the number and type offor different purpose depending on the number and type ofargumentargument

    It is type of a function overloadingIt is type of a function overloading

    It can be said under a common name required number ofIt can be said under a common name required number ofoperations can be performed depending on parameters passedoperations can be performed depending on parameters passed

    ExEx--Two differ shapes will be drawn under a common function butTwo differ shapes will be drawn under a common function but

    different parametersdifferent parameters

    RectangleRectangle CircleCircle

    draw(x,y);draw(x,y); draw(x);draw(x);

  • 8/6/2019 Object Oriented Programming(Slides)

    6/8

    INHERITANCEINHERITANCE

    Inheritance is the concept of a child class automatically inheriting theInheritance is the concept of a child class automatically inheriting thevariables and methods defined in its parent classvariables and methods defined in its parent class

    A child class is also called sub class (which inherits)A child class is also called sub class (which inherits)

    A parent class is also called super class (which is inherited)A parent class is also called super class (which is inherited)

    It makes all the functions and variables of parent class available to subIt makes all the functions and variables of parent class available to subclass i.e all the functions of parent class can be called directly by sub classclass i.e all the functions of parent class can be called directly by sub class

    Types of inheritance are:Types of inheritance are:

    Single class inheritanceSingle class inheritance Multilevel inheritanceMultilevel inheritance

    Multiple InheritanceMultiple Inheritance Hierarchical InheritanceHierarchical Inheritance

    Hybrid InheritanceHybrid Inheritance

  • 8/6/2019 Object Oriented Programming(Slides)

    7/8

    Application of OOPApplication of OOP

    RealReal--time systemstime systems

    Stimulation and modelingStimulation and modeling

    ObjectObject--oriented databasesoriented databases

    Hypertext, hypermedia and expertextHypertext, hypermedia and expertext

    AI and expert systemsAI and expert systems

    Neutral networks and parallel programmingNeutral networks and parallel programming

    Decision support and office automation systemsDecision support and office automation systems

    CIM/CAD/CAD systemCIM/CAD/CAD system

  • 8/6/2019 Object Oriented Programming(Slides)

    8/8

    ConclusionConclusion

    This report on Object oriented programming has let meThis report on Object oriented programming has let me

    conclude that Object oriented is one of the most importantconclude that Object oriented is one of the most important

    concept in the programming which helps the programmer toconcept in the programming which helps the programmer to

    program more effectively and efficiently. The main feature isprogram more effectively and efficiently. The main feature is

    the flexibility of classes and objects which saves programmersthe flexibility of classes and objects which saves programmers

    time. It provides some of the features like data abstraction,time. It provides some of the features like data abstraction,

    encapsulation, polymorphism, inheritance which has made itencapsulation, polymorphism, inheritance which has made it

    possible for the object oriented programming concept to bepossible for the object oriented programming concept to be

    used in the real world situations.used in the real world situations.

    So to be an effective programmer one must go through theSo to be an effective programmer one must go through the

    concept of Object oriented programming thoroughly.concept of Object oriented programming thoroughly.