OOP ASSIGNMENT by nuhman10

VIEWS: 43 PAGES: 49

									Unit title: Object Oriented Programming




Summary: This paper analyses the components, techniques
and principles involved in OOP with different examples of
code in c++.




By: Mohammed Ahsan Ali (IT Lecturer )




                                                            1
                  TASK 1


Describe the different components involved in
      OOP and their appropriate usage




                                                2
Introduction:


Object Oriented Approach related to other paradigms:


Like computer hardware, programming languages have been passing through different
evolutionary phases and paradigms. These different paradigms are:


Monolithic Programming:
The programming written in these languages consists of global data and sequential code.
Program flow control is achieved through the use of jumps. The program code is
duplicated each time when it has to be used. Since there is no support of subroutine
concept, it is suitable for development of small and simple applications. Assembly
language and BASIC language are example of Monolithic paradigm.


Procedural Programming:
In Procedure Programming, programs are divided into individual procedures that perform
discrete tasks. Procedures have their own local data. Parameters are passed between the
procedures for information communication. More suitable for medium sized software
applications.


Structured Programming:
In structured programming, program consists of multiple modules and in turn, each
module has a set of functions of related types. The usage of separately compiled modules
was the answer for managing large size projects.


Object Oriented Programming:
Software designer and programmer have faced difficulty in the design, maintenance, and
enhancement of software development using traditional languages, and their search for a
better methodology has resulted in the development of the object oriented approach.



                                                                                      3
Unlike the traditional paradigms, where the emphasis was on functions, Object-Oriented
Programming emphasis on both data as well as on functions. Data and functions are
encapsulated in a single unit called objects. In Structured and Procedure Programming
language, the problem is divided into functions, whereas in OOP the problem is divided
into objects.


In the conventional programming languages, data are declared and accessible to all the
functions of a program without any restriction. It reduced data security and integrity,
since the entire data is available to all the functions and functions can change any data
without any restriction. But OOP adopt the concept of data hiding by making all the data
private and members functions public, and only public member functions can access the
data of respective class.


All Above given paradigms can not solve the problem of the problem of software crisis
(project not complete within time and budget, not fulfill all the customer’s requirements).
To overcome the problem of software crisis, real life principles and concepts e.g.
Abstraction, Inheritance, Polymorphism have been introduce in a paradigm called Object
Oriented Paradigm.


Class:


A class is a way to bind the data and its associated functions together. When defining a
class, we are creating a new data type that can be treated like any other built-in data type.
The body of a class is enclosed within braces and terminated by a semicolon. The class
body contains the declaration of variables and functions. These function and variable are
collectively called class members. Generally, a class specification has two parts:
   1. class declaration
   2. Class function definition



                                                                                           4
Class declaration describes the type and scope of its members. The class function
definition describes how the class functions are implemented.


class rectangle // class declaration
{
     private:


                int length;
                int width;
     public:
               void input();
               void output();
};


void rectangle::input(void) // class function definition
{
      cin>>length;
      cin>>width;
}


void rectangle::output(void)
{
      area=length*width;
      cout<<area:
}
Object:


Once a class has been declared, we can create variables of that type. In C++, the class
variables are known as objects or instance. We may declare more than one object in one



                                                                                     5
statement. Class only provides a template and does not create any memory space to the
objects and the necessary memory space is allocated to an object when it is declared.


Objects are the building blocks that make up a program. It is difficult to explain exactly
what an object is because an object can be anything you want. For example, you can
create an object that represents an alien that can hold all information related to the alien
and also contain functionality associated with it. You can include data such as the number
of lives the alien has and also the functionality to affect the data, such as code to kill the
alien, which could remove one of the lives.
The essential elements that make up an object are variables and methods. Variables are
data members, or attributes, that contain data relating to the object, such as a text string or
numeric value. Methods provide the functionality of the object and can be used to interact
with the attributes. Methods are also known as functions or procedures in various other
programming languages.




Difference between C and C++:


C is a structured programming language created by Dennis Ritchie in 1972 at AT & T
Bell Labs. C++ is an Object Oriented Language developed by Bjarne Stroustrup in 1979
in the same AT & T Bell Lab. The difference between C and C++ are following:


      In C, like all structured languages, problem is divided into functions, but in C++
       being an Object Oriented language, problem is divided into objects.


      Abstraction, Data Hiding, Inheritance, Polymorphism are essential properties of
       C++, but C language does not follow these properties.




                                                                                             6
      C language follows Top down approach but C++ follows Bottom up approach. In
       Top down approach, project is initialized without going in details. Problem is
       divided into modules and sub modules, but as the project progress; and problem
       become more understandable; modules and sub module are further defined and
       extended. But in bottom up approach, before development, project is understood
       in great detail and problem is divided into well defined modules and sub modules.
       Both approaches have their advantages and disadvantages.


      Concept of reference variable exists in C++, but there is no concept of reference
       variable in C.


      For Dynamic memory allocation, two new operators delete and new are
       introduced in C++ which does not exist in C.


      In C++, user defined function struct can encapsulate both data and function as its
       members and support many Object Oriented features like class in C++, but struct
       in C can only have attributes as its member.


      For file handing C++ have the concept of input output streams, but there is no
       concept of input output streams in C language.


      C++ supports generic programming by using template class and template
       function, but C does not support generic programming.




Static Data Member:
A data member in a class can be declared as static. A static data member has certain
special characteristics. These are:




                                                                                       7
        Only one copy of that member is created for the entire class and is shared by all
         the objects of that class, so it is also called class data member.
        It must be declared as private data member.
        It can be accessed not only by the object name but also with the class name.
        It is initialized to zero when the first object of its class is created.


Below given program illustrates the use of static data member:


class rectangle
{
     private:
                   int length;
                   int width;
                   int area;
                   static int count;
     public:
               void input()
               {     cin>>length;
                     cin>>width;
               }


               void output()
               {     cout++;
                     area=length*width;
                     cout<< area of rectangle << count << “is = “<<area:
               }


};




                                                                                        8
void main()
{
        rectangle r1, r2, r3;
        r1.input();
        r1.output();
        r2.input();
        r2.output();
        r3.input();
        r3.output();


}




Static Member Function:
A member function in a class can be declared as static. A static member function has
certain special characteristics. These are:


       A static function can have access to only other static members.
       A static member function can be accessed not only by the object name but also
        with the class name.


Below given program illustrates the use of static data member:


class rectangle
{
    private:
                  int length;
                  int width;
                  int area;



                                                                                   9
                   static int count;
     public:
               void input()
               {     cin>>length;
                     cin>>width;
               }
               void static fcount()
               {
                   count++;
                   cout>>count;
               }
               void output()
               {     cout++;
                     area=length*width;
                     cout<< area of rectangle << fcount() << “is = “<<area:
               }
};
void main()
{
        rectangle r1, r2, r3;
        r1.input();
        r1.output();
        r2.input();
        r2.output();
        r3.input();
        r3.output();


}




                                                                              10
Dynamic memory allocation (new and delete operators in C++):


When memory is allocated at compile time, it is called static memory allocation and
when memory is allocated at run time (during program execution), it is called
dynamic memory allocation. We use dynamic memory allocation when it is not
known in advance how much of memory space is needed. C++ defines two unary
operators new and delete that perform the task of of allocating and freeing the
memory in a better and easier way.


new:
an object can be dynamically created (during runtime) by using new operator when
required. Some characteristics of new operator are:
          We need not to use the operator sizeof() which we require in malloc(), it
           automatically computes the size of the data or object.
          new automatically return the correct type, so that there is no need to use a type
           cast.
          through new it is possible to initialize the object while creating the memory
           space.
          If sufficient memory is not available for allocation, new returns a null pointer.
e.g.


int *p = new int;


int *p = new int(34); // memory allocation and initialization simultaneously




delete:




                                                                                         11
   an object can be destroyed explicitly during runtime by using delete operator so that
   memory space can be reused. e.g.


   delete p;



Garbage Collection:

In computer science, garbage collection (GC) is a form of automatic memory
management. Garbage collector is a special function or procedure for memory
management which attempts to reclaim garbage, or memory occupied by objects that are
no longer in use by the program. Garbage collection was invented by John McCarthy
around 1959 to solve problems in Lisp.

Garbage collection is often portrayed as the opposite of manual memory management. In
manual memory management, objects are found which objects are no longer in use and
special functions are called to deallocate them.

Many computer languages have inbuilt garbage collector as part of the language
specification (e.g., Java, C#, and most scripting languages), but C++ do not have inbuilt
garbage collector as part of the language. But we can create a special Garbage collector
function or procedure in C++ and can add it in the language.

Access Modifiers:


To implement data hiding in C++, there are three different types of access modifiers:


Private:
If a data member or member function is declared Private, then it can only be accessed by
member functions.




                                                                                        12
Protected:
If a data member or member function is declared Protected, then it can be accessed by
member functions of its class and derived class.


Public:
If a data member or member function is declared Public, then it can be accessed by all
functions in the program.


Accessibility of a data member and member function in the derived class, not only
depends on its access modifier; but also on the access mode, by which mode, the base
class is derived by the derived class as in the block diagram and table given below:




                                                                                       13
14
                  Task 2
Describe the principles involved in OOP and
          their appropriate usage




                                         15
Basic Concepts of Object Oriented Programming (Principles of Object
Oriented Languages):


       Abstraction
       Encapsulation
       Data hiding
       Inheritance
       Polymorphism




Abstraction:
Abstraction refers to the act of representing essential features which have to be used and
required and leaving out the features which are not required. In Object Oriented
languages Class is an example of Abstraction and therefore it is called Abstract Data
Type (ADT). e.g. if we want to calculate the area of a rectangle then we only require
length, width and area as data members of the rectangle class, and there is no need to
declare and define any other attribute in the class as given below:


class rectangle
{
    private:


               int length;
               int width;
               int area;


    public:
              void input()
              {


                                                                                       16
                     cin>>length;
                     cin>>width;
            }


            void output()
            {
                     area=length*width;
                     cout<< area is = <<area:
            }


};




Encapsulation:
The Wrapping up of data and functions into a single unit (called class) is known as
encapsulation. Data encapsulation is the most important feature of a class. Data in the
class are called data members and functions in the class are called member functions of
the class. e.g. in the class given below, length, width, area are data members and input()
and output() are member functions of the rectangle class. And these all class members
work as a unit in the class. e.g.


class rectangle
{
     private:


                int length;
                int width;



                                                                                       17
               int area;


     public:
           void input();
           void output()
};




Data Hiding/ Information Hiding:
There are two keywords in Object Oriented languages: public and private, and these
keywords are called visibility levels. Class members that have been declared as private
can be accessed only within the class. On the other hand, public members can also be
accessed from outside the class. The use of the keyword private is optional. By default
the members of a class are private. In this way, declaring all the data members private
and member functions public, we follow the concept of Data hiding in C++.




                                                                                    18
Inheritance:
The mechanism of deriving a new class from old one is called inheritance. The old class
is referred to as the base class or parent class and the new class is called the derived class
or child class. The derived class inherits some or all the features of the base class.
Inheritance provides the concept of reusability. We can implements all types of
inheritance in C++: single inheritance, multiple inheritance, hierarchical inheritance,
multilevel inheritance and hybrid inheritance. Example of single inheritance is given
below.


class person
{
     public:
              char name[10];
              char fname[10];
              char address[20];
};


class student : person
{     public:
             int enroll_no;
             char cname[10];


             student()
         {
               cin<< name;
               cin<<fname;
               cin<<address;
               cin<<enroll_no
               cin<<cname;



                                                                                           19
             }
             void display();
};


void student :: display()
{                 cin<< name;
                  cin<<fname;
                  cin<<address;
                  cin<<enroll_no
                  cin<<cname;
}


void main()
{
     student s1, s2;
     s.display();
}




Types of Inheritance:
The mechanism of deriving a new class from old one is called inheritance. The old class
is referred to as the base class or parent class and the new class is called the derived class
or child class. The derived class inherits some or all the features of the base class.
Inheritance provides the concept of reusability. There are different types of inheritance in
C++ as given below:
                Single level inheritance
                Multiple level inheritance
                Hierarchical inheritance
                Multilevel inheritance



                                                                                           20
               Hybrid inheritance




Single level inheritance:


A derived class with one base class is called single level inheritance. Block diagram
given below shows the single level inheritance.




Example:


class student
{
    private:
              int enroll;
              char name[20];
              char course[20];
    public:
              void input_stud();
              void display_stud();
};



                                                                                  21
void student::input_stud()
{
          cout<<"enter enroll:";
          cin>>enroll;
          cout<<"enter name:";
          cin>>name;
          cout<<"enter course:";
          cin>>course;
}


void student::display_stud()
{
          cout<<"enroll is:"<<enroll;
          cout<<"\nname is:"<<name;
          cout<<"\ncourse is:"<<course;


}


class exam:public student
{
    private:
              int msub1;
              int msub2;
              int msub3;
    public:
              void input_exam();
              void display_exam();
};



                                          22
void exam::input_exam()
{
          cout<<"enter marks of subject1:";
          cin>>msub1;
          cout<<"enter marks of subject2:";
          cin>>msub2;
          cout<<"enter marks of subject3:";
          cin>>msub3;
}


void exam::display_exam()
{
          cout<<"\nmarks in subject1 is:"<<msub1;
          cout<<"\nmarks in subject2 is:"<<msub2;
          cout<<"\nmarks in subject3 is:"<<msub3;
}


void main()
{
    clrscr();
    exam e1;
    e1.input_stud();
    e1.input_exam();
    e1.display_stud();
    e1.display_exam();
    getch();
}




                                                    23
Multilevel inheritance:


The mechanism of deriving a class from another ‘derived class’ is known as multilevel
inheritance.




Example:


class student
{
    protected:
           char course[20];
           char name[20];
           int enroll;
};


class exam:public student
{



                                                                                  24
    protected:
              char etype[20];
              int msub1;
              int msub2;
              int msub3;
};


class result:public exam
{
    private:
              int tmarks;
    public:
              void input();
              void total();
              void display();
};


void result::input()
{
          cout<<"enter enroll:";
          cin>>enroll;
          cout<<"enter name:";
          cin>>name;
          cout<<"enter course:";
          cin>>course;
          cout<<"enter exam type:";
          cin>>etype;
          cout<<"enter marks of subject1:";
          cin>>msub1;



                                              25
          cout<<"enter marks of subject2:";
          cin>>msub2;
          cout<<"enter marks of subject3:";
          cin>>msub3;
}




void result::total()
{
          tmarks=msub1+msub2+msub3;
}




void result::display()
{
          cout<<"enroll:"<<enroll;
          cout<<"\nname:"<<name;
          cout<<"\ncourse:"<<course;
          cout<<"\nexam type:"<<etype;
          cout<<"\n total marks:"<<tmarks;
}


void main()
{
    clrscr();
    result r1;
    r1.input();
    r1.total();
    r1.display();



                                              26
    getch();
}




Multiple inheritance:


The mechanism of deriving a class from two or more classes is known as multiple
inheritance.




Example:


#include<iostream.h>
#include<conio.h>


class student
{
    protected:
           char course[20];



                                                                            27
              char name[20];
              int enroll;
};


class exam
{
    protected:
              char etype[20];
              int msub1;
              int msub2;
              int msub3;
};


class result:public student, public exam
{
    private:
              int tmarks;
    public:
              void input();
              void total();
              void display();
};


void result::input()
{
          cout<<"enter enroll:";
          cin>>enroll;
          cout<<"enter name:";
          cin>>name;



                                           28
        cout<<"enter course:";
        cin>>course;
        cout<<"enter exam type:";
        cin>>etype;
        cout<<"enter marks of subject1:";
        cin>>msub1;
        cout<<"enter marks of subject2:";
        cin>>msub2;
        cout<<"enter marks of subject3:";
        cin>>msub3;
}




void result::total()
{
        tmarks=msub1+msub2+msub3;
}




void result::display()
{
        cout<<"enroll:"<<enroll;
        cout<<"\nname:"<<name;
        cout<<"\ncourse:"<<course;
        cout<<"\nexam type:"<<etype;
        cout<<"\n total marks:"<<tmarks;
}


void main()



                                            29
{
    clrscr();
    result r1;
    r1.input();
    r1.total();
    r1.display();
    getch();
}




Ambiguity resolution in multiple inheritance:


While using multiple inheritance, if same name is assigned to two different functions in
two different base classes and if any of the function is called from the derived class then
it becomes ambiguous to the compiler which function is called; this is called ambiguous
problem in multiple inheritance. To resolve this problem, class name is also mentioned
with the function names, while calling these types of functions from the derived class as
shown in the example given below:


class student
{
    private:
              char course[20];
              char name[20];


    protected:
              int enroll;


    public:



                                                                                        30
           void input_stud();
           void display();


};


void student::input_stud()
{
          cout<<"enter enroll:";
          cin>>enroll;
          cout<<"enter name:";
          cin>>name;
          cout<<"enter course:";
          cin>>course;
          cout<<"enter exam type:";
}


void student::display()
{
          cout<<"enroll:"<<enroll;
          cout<<"\nname:"<<name;
          cout<<"\ncourse:"<<course;
}


class exam
{
    private:
           char etype[20];
    protected:
           int msub1;



                                       31
              int msub2;
              int msub3;


    public:
               void input_exam();
               void display();
};


void exam::input_exam()
{
          cout<<"enter exam type:";
          cin>>etype;
          cout<<"enter marks of subject1:";
          cin>>msub1;
          cout<<"enter marks of subject2:";
          cin>>msub2;
          cout<<"enter marks of subject3:";
          cin>>msub3;
}


void exam::display()
{
          cout<<"\nexam type:"<<etype;
}


class result:public student, public exam
{
    private:
              int tmarks;



                                              32
    public:
              void total();
              void result_display();
};


void result::total()
{
          tmarks=msub1+msub2+msub3;
}


void result::result_display()
{
          cout<<"\n total marks:"<<tmarks;
}


void main()
{
    clrscr();
    result r1;
    r1.input_stud();
    r1.input_exam();
    r1.total();
    r1.student::display();
    r1.exam::display();
    r1.result_display();
    getch();
}




                                             33
Hierarchical inheritance:


The mechanism of deriving two or more classes from the same class is known as
Hierarchical inheritance. The base class will include all the features that are common to
the subclasses. A subclass can serve as a base class for the lower level classes and so on.




class student
{
    protected:
           char course[20];
           char name[20];
           int enroll;
};


class fee:public student
{
    private:



                                                                                         34
              int adminfee;
              int hostelfee;
              int transpfee;
              int totalfee;
    public:
              void input();
              void total();
              void display();
};


void fee::input()
{
          cout<<"enter admission fee:";
          cin>>adminfee;
          cout<<"enter hostel fee:";
          cin>>hostelfee;
          cout<<"enter transport fee:";
          cin>>transpfee;
}
void fee::total()
{
          totalfee=adminfee+hostelfee+transpfee;
}


void fee::display()
{
          cout<<"total fee:"<<totalfee;
}




                                                   35
class exam:public student
{
    private:
              char etype[20];
              int msub1;
              int msub2;
              int msub3;


    public:
              void input();
              void display();
};


void exam::input()
{
          cout<<"enter exam type:";
          cin>>etype;
          cout<<"enter marks of subject1:";
          cin>>msub1;
          cout<<"enter marks of subject2:";
          cin>>msub2;
          cout<<"enter marks of subject3:";
          cin>>msub3;
}


void exam::display()
{
          cout<<"\nexam type:"<<enroll;
          cout<<"\nsubject1:"<<msub1;



                                              36
          cout<<"\nsubject2:"<<msub2;
          cout<<"\nsubject3:"<<msub3;
}


void main()
{ clrscr();
    exam e1;
    fee f1;
    f1.input();
    f1.total();
    f1.display();
    e1.input();
    e1.display();
    getch();
}




Hybrid inheritance/ ambiguity in hybrid inheritance/ multipath problem in
inheritance/ virtual base class:


Sometimes we need to apply two or more types of inheritance to design a program and
this type of inheritance is called hybrid inheritance. But in hybrid inheritance, if multiple
paths exit between a base class and derived class through different intermediate classes,
then derived class inherits the members of the base class more than one time and it results
in ambiguity. Here, base class is called indirect base class and intermediate base classes
are called direct base classes.
To avoid this ambiguity, the indirect base class is made virtual base class and to define
base class as virtual, a keyword virtual is appended when extending the direct base



                                                                                          37
classes from the indirect base class as given in the example. In this way, when we define
the indirect base class virtual, compiler take care that only one copy of that class is
inherited, regardless of how many inherited paths exist between the virtual base class and
the derived class.




Example:
class student
{
    protected:
           char course[20];
           char name[20];
           int enroll;
};


class exam:virtual public student
{
     protected:
           char etype[20];
           int msub1;



                                                                                       38
              int msub2;
              int msub3;
};


class sports:virtual public student
{
     protected:
              char sname[20];
              int smarks;
};


class result:public exam, public sports
{
    private:
              int tmarks;
    public:
              void input();
              void total();
              void display();
};


void result::input()
{
          cout<<"enter enroll:";
          cin>>enroll;
          cout<<"enter name:";
          cin>>name;
          cout<<"enter course:";
          cin>>course;



                                          39
        cout<<"enter exam type:";
        cin>>etype;
        cout<<"enter marks of subject1:";
        cin>>msub1;
        cout<<"enter marks of subject2:";
        cin>>msub2;
        cout<<"enter marks of subject3:";
        cin>>msub3;
        cout<<"enter sports name:";
        cin>>sname;
        cout<<"enter sports marks:";
        cin>>smarks;


}


void result::total()
{
        tmarks=msub1+msub2+msub3+smarks;
}


void result::display()
{
        cout<<"enroll:"<<enroll;
        cout<<"\nname:"<<name;
        cout<<"\ncourse:"<<course;
        cout<<"\nexam type:"<<etype;
        cout<<"\ntotal marks:"<<tmarks;
}




                                            40
void main()
{
    clrscr();
    result r1;
    r1.input();
    r1.total();
    r1.display();
    getch();
}




Polymorphism:
Polymorphism is also one of the main features of object oriented programming.
Polymorphism means ‘one name, many forms’. In C++, there are static polymorphism
and dynamic polymorphism. Function overloading and operator overloading are
examples of static polymorphism and function overriding is an example of dynamic
polymorphism. Example given below illustrates function overloading, one of the type of
static polymorphism.


class rectangle
{
      private:


                  int length;
                  int width;
                  int area;



                                                                                   41
     public:
               input();
               input(int,int);
               void output();
};


void rectangle::input()
{
      length=5;
      width=10;
}


void rectangle::input(int l, int w)
{
      length=l;
      width=w;
}


void rectangle::output(void)
{
      area=length*width;
      cout<<area:
}


void main()
{     rectangle r1, r2;
     r1.input();
     r2.input(10,20);
     r1.output();



                                      42
        r2.output();
}




Polymorphism and types of Polymorphism:


Polymorphism is also one of the main features of object oriented programming.
Polymorphism means ‘one name, many forms’. In C++, there are different types of
polymorphism as given below:


Static polymorphism / Compile time polymorphism/ static binding/ static linking:


         Function overloading
         Operator overloading


Dynamic polymorphism/ Run time polymorphism/ dynamic binding/ dynamic
linking:


         Function overriding




Function Overloading:


Using a single function name to handle different numbers and different types of
arguments to perform different types of tasks is known as function overloading.


Example:




                                                                                   43
class rectangle
{
     private:
                int length;
                int width;
                int area;
     public:
               input();
               input(int,int);
               void output();
};


void rectangle::input()
{
      length=5;
      width=10;
}




void rectangle::input(int l, int w)
{
      length=l;
      width=w;
}


void rectangle::output(void)
{



                                      44
        area=length*width;
        cout<<area:
}


void main()
{       rectangle r1, r2;
       r1.input();
       r2.input(10,20);
       r1.output();
       r2.output();
}




Operator overloading:


The process of making an operator to exhibits different behaviours in different instances
is known as operator overloading.




class rectangle
{
    private:
              int length;
              int width;
    public:
              void input();
              rectangle operator+(rectangle);
              void display();
};



                                                                                      45
void rectangle::input()
{
       cout<<"enter length:";
       cin>>length;
       cout<<"enter width:";
       cin>>width;
}




rectangle rectangle::operator+(rectangle r4)
{
       rectangle r5;
       r5.length=length+r4.length;
       r5.width=width+r4.width;
       return(r5);
}




void rectangle::display()
{
       cout<<"length:"<<length;
       cout<<"\nwidth:"<<width;


}




                                               46
void main()
{
    clrscr();
    rectangle r1,r2,r3;
    r1.input();
    r2.input();
    r3=r1+r2;         // r3=r1.operator+(r2);
    r3.display();
    getch();
}


Conclusion
I don't think, that it is realistic trying to make a programming language be everything to
everybody. The language becomes bloated, hard to learn, and hard to read if everything
plus the kitchen sink is thrown in. In another word every language has their limitations.
As system architect and designer we should be able to fully and more importantly
correctly (this also mean that you shouldn’t use a ballistic missile to kill a fly or hire FBI
to catch the fly) utilize the available tools and features to build usable, sustainable,
maintainable and also very importantly expandable software systems, that fully utilize the
feature of the language to bring a competitively advance system to their customers. In
order to do it, the foundation of a system places a vital role. The design or the
architecture of a software system is the foundation. It hold the system together, hence
designing a system properly is the key to the success. When you talk about designing a
software system, the correct handling of OOP concept is very important. I have made the
above paper richer with idea but still kept it short so that one can learn/ remind all of
important concept at a glance




                                                                                           47
References


Henrik Bengtsson. com.braju.sma - object-oriented microarray analysis in 100% R,
2002a.
URL http://www.maths.lth.se/help/R/.


Henrik Bengtsson. The com.braju.sma package - a microarray analysis package
based on an object-oriented design and reference variables, 2002b.
URL http://www.maths.lth.se/help/R/.


Henrik Bengtsson. Programming with references - a case study using the R.oo
package, 2002c.
URL http://www.maths.lth.se/help/R/.


Henrik Bengtsson. R Coding Conventions (draft), 2002d
URL http://www.maths.lth.se/help/R/.


Henrik Bengtsson. Safely creating S3 generic functions using setGenericS3(), 2002e.
URL http://www.maths.lth.se/help/R/.


Henrik Bengtsson. The R.classes bundle (R.oo and friends), 2003.
URL http://www.maths.lth.se/help/R/.


JohnM. Chambers. The definition of generic functions and methods, January 2002a.
URL http://developer.r-project.org/methodDefinition.html.


John M. Chambers. S language methods and classes, 2002b.


John M. Chambers and Duncan Temple Lang. Object-oriented programming in R.



                                                                                      48
R News, 1(3):17–19, September 2001.
URL http://CRAN.R-project.org/doc/Rnews/.


John M. Chambers and Duncan Temple Lang. OOP programming in the S language,
2002.
URL http://www.omegahat.org/OOP/.


Andrew Shalit, David Moon, and Orca Starbuck. The Dylan Reference Manual:
The Definitive Guide to the New Object-Oriented Dynamic Language. Addison-
Wesley Publishing Company, 1996. ISBN 0-201-44211-6.


R Development Core Team. R Language Definition (v1.7.0, draft), April 2003a.


R Development Core Team. Writing R Extensions (v1.7.0), April 2003b.




Useful links:
http://www.w3schools.com/
http://www.w3schools.com/js/js_obj_htmldom.asp
http://www.w3schools.com/jsref/jsref_events.asp
http://www.javascripter.net/index.html
http://www.javascripter.net/faq/javascr4.htm




                                                                               49

								
To top