My_seminar on Oop

Embed Size (px)

Citation preview

  • 8/8/2019 My_seminar on Oop

    1/21

    Assignment:Analyze the Basic Object Oriented Principles bycomparing to the Real world and programming in frontof your Department Members and students ?

    Author Of Thinking In C,

    Author Of Thinking In C++

    Author Of Thinking In Java

    My Answer is In the form of Seminar

    By BruceEckel

  • 8/8/2019 My_seminar on Oop

    2/21

    Basics Of Object OrientedProgramming?

    Introduction

    OOP Terminology

    SDLC [ Software Design Life Cycle ]

  • 8/8/2019 My_seminar on Oop

    3/21

  • 8/8/2019 My_seminar on Oop

    4/21

    OOP Terminology:

    1.Objects & Classes

    2.Abstraction

    3.Encapsulation4.Polymorphism

    5.Inheritance6.Definition of OOP

    7.OOP languages

  • 8/8/2019 My_seminar on Oop

    5/21

  • 8/8/2019 My_seminar on Oop

    6/21

    1.Objects & Classes

    Definition: Object is an identifiable entity withsome characteristics and behaviors. It mayrepresents a person, place ,a thing and so on.

    ( OR )

    Object should be chosen such that they matchclosely with Real-World.

    Focus On Real-World Example:

    Let us say Orange is an Object. Its characteristicsare

    characteristics = Spherical Shaped

    = Orange in Color

    Behavior =Juicy and Sweet

    =Preparing Flaviuors &Chocolates

  • 8/8/2019 My_seminar on Oop

    7/21

    Focus on Programming Ex:

    Characteristics are Represented by its Data and

    Behavior is Represented by its Functions

    E.g.: STUDENT is an Object

    characteristics = Roll no, Name ,Course,DOB .

    Behavior = Reading() , Writing().

    In C++ Characteristics=Data=Data Members

    Behaviors (OR) Actions =Functions=Member Functions

    Characteristics & Behaviors =Members

    In Java we call as Data and Methods.

  • 8/8/2019 My_seminar on Oop

    8/21

    Class

    Definition 1: A class is a Template (or) User-defineddata type which can combine data as well as methodsof an object.

    Definition 2: A Class is a set of Objects that sharecommon data and common Behavior.

    Focus on Real life Example:

    Let us Consider Rubber stamp is a Class it givesdifferent imprints. These imprints are nothing butObjects.

    Note : Objects are also the Instance of Class(According to Boochs Definition.)

    Rubber stamp(object class)

    Imprints(object instances)

  • 8/8/2019 My_seminar on Oop

    9/21

    Focus on Programming E.g.:

    Let us Consider STUDENT is a Class .The studentmay be MCA,MA,B.A ,M.sc etc.

    All Charecrastics are considered as data and all

    Behaviors are considered to be Member functionsthese are placed in the definition of CLASS

    i.e.

    class student{

    private:int rollno;char name[20];char course[20];public:

    void read( );

    void disp( );};

  • 8/8/2019 My_seminar on Oop

    10/21

    Abstraction

    Definition: It is the process of identifying data membersand member functions of a class relevant to the application

    in hand. Identifying essential data members is known asData Abstraction .While identifying methods is known asProcedural Abstraction

    Focus on Real-Life Example:

    When a person is student

    Roll NO

    DOB

    Course are ATTRIBUTES

    When a person went to Bank he has different attributes

  • 8/8/2019 My_seminar on Oop

    11/21

    Encapsulation Definition: Encapsulation is the

    most fundamental concept of OOP.It is the process of hiding datamembers by wrapping up of dataand methods as a single unit(Called Class) to prevent beingaccessed by outside world .

  • 8/8/2019 My_seminar on Oop

    12/21

    POLYMORPHISM

    Definition : It is the ability of a function totake more than one form of a functioncan have many forms. Functions nameis same but parameters are different.

    Focus on Real-Life Example: Let usconsider the Hollywood Actor CharleyChaplin he is the one person and can beacted on different character .

  • 8/8/2019 My_seminar on Oop

    13/21

    Definition: It is the ability of a function totake more than one form of a functioncan have many forms. Functions name issame but parameters are different.

    Focus on Example:void add (int x,int y)void add (float x,float y)void add (int x,int y,int z)

    void add (char x,char y ) In the above example void add() is

    member function, it can performsoperations on two int ,two floats, threeint and two chars .

    Focus on Programming Example:

  • 8/8/2019 My_seminar on Oop

    14/21

    Inheritance

    Definition: Inheritance is the backbone of Object Oriented Programming .It is a Process of deriving a new class from existing Class. The NewClass gets all the properties and methods of Existing Class.

    Super Class: It is class from which a class isderived. It is also known as Parent (or)" baseclass..Sub Class: It is Class which inherits its propertiesand methods from base class. It is also known aschild class (or) derived class.

    Parent (or)Base Class

    Child (or)Derived Class

  • 8/8/2019 My_seminar on Oop

    15/21

    Focus on Real-life Example:

    Animal

    Amphibians Reptiles

    Non-Human beings

    Mammals

    Human beings

    Amphibians: Animals which lived in water as well as on the earth.

    Reptiles: Which Crawls on the Earth.

    Mammals: Which gives milk to their Babies.

  • 8/8/2019 My_seminar on Oop

    16/21

    Person

    Employee Engineer student

    MCA B.Tech Medicine

    From Top to BottomSpecialization Takes Place

    From Bottom to TopGeneralization Takes place

  • 8/8/2019 My_seminar on Oop

    17/21

    Definition of OOP

    Definition: Object oriented Programming is amethod of implementation in which programsare Organized as a Co-Operative collection of Objects ,each of which represents an instanceof some class and whose classes are all the

    Members of a hierarchy of a classes United viainheritance Relationships.

    OOP languages

    Eiffel

    Small Talk

    Ada

    Java

    Object Pascal

    Objective C

    C++

  • 8/8/2019 My_seminar on Oop

    18/21

    SDLC [ Software Design Life Cycle ]

    OOA (Object Oriented Analysis ) OOD (Object Oriented design) OOP (Object Oriented Programming)

    OOA: It is a process of analyzing and understandinghe problem / system in terms of real-world objects,heir properties and actions.

    OOD: It is a processes of modeling the solution toproblem using object oriented concepts. In OOD wemade the abstractions and Mechanisms that providehe behavior that this model requires.

    OOP: Object oriented Programming is a method of

    mplementation in which programs are Organized as Co-Operative collection of Objects ,each of whichepresents an instance of some class and whoselasses are all the Members of a hierarchy of alasses United via inheritance Relationships.

  • 8/8/2019 My_seminar on Oop

    19/21

  • 8/8/2019 My_seminar on Oop

    20/21

    Customer Request

    Write Request

    Design

    Code

    User Test

    Redesign

    Deliver to Customer

  • 8/8/2019 My_seminar on Oop

    21/21

    According to Chinese Proverb

    when you hear something ,you will forget it,When you see something ,you will Remember it

    But not until you do something,will you understand it

    Any Suggestions,Drawbacks.. Regardingto this Seminar Mail Meat