2. INTRODUCTION Languages that support OOP are firmly entrenched in the mainstream. From COBOL to LISP c++, Ada 95, and CLOS, an OOP version of LISP. C++ and Ada 95 support procedural- and data-oriented programming, CLOS also supports funcitonal programming. Some of the newer languages that were designed to support object-oriented programming do not support other programming paradigms, but still employ some of the basic structures and have the appearance of the older imperative languages. Among these are Eiffel and Java. Smalltalk was the first language to offer complete support for object-oriented programming. This is inheritance, which is at the center of object-oriented programming and the languages that support it.
3. INTRODUCTION The concept of object-oriented programming has its roots in SIMULA 67 but was not fully developed until the evolution of Smalltalk resulted in producing Smalltalk 80 (in1980, of course). Three key languages: -abstract data types -inheritance -a particular kind of dynamic binding Procedure-oriented programming focuses on subprograms and subprogram libraries. Data-oriented programming focuses on abstract data types. The Sorting process is enacted by calling that operation on the specific array object. The data-oriented programming paradigm was popular in the 1980s, and it served by the data abstraction facilities of Modula-2, Ada, and several more recent languages. Object-based languages are the languages that support data-oriented programming. Object-Oriented Programming
4.
5. Inheritance offers a solution to both modification problem posed by abstract data type and the program organization problem. If a new abstract data type can inherit the data and functionality of some existing type, and is also allowed to modify some of those Entities and add new entities, reuse is greatly facilitated without changes to the reused data type. The abstract data types in OOP, following the lead of SIMULA 67, are usually called classes . As with instances of abstract data types, Class instances are called objects . A class that is defined through Inheritance from another class is a derived class or subclass . A class from which the new class is derived is its parent class or superclass . The sub-programs that define the operations on objects of a class are Called methods . The calls to methods are often called messages . The entire collection of methods of an objects is called the message protocol , or message interface , of the object.
6. A modified method has the same name. and often the same protocol, As the one of which it is a modification. The new method is said to override the inherited version, which is then called an overriden method. The most common purpose of an overriding method Is to provide an operation that is specific for objects of the derived class but is not appropriate for objects of the parent class. classes can have two kinds of methods and variables. The most commonly used methods and variables are called instance methods And variables. Every object of a class has its own set of instance variables, which store the objects state. The only difference between two objects of the same class is the state of their instance variables. Instance methods operate only on the objects of the class. Class variables belong to the class, rather than its object, so there only one copy for the class. Class methods can perform operations on the class, and possibly also on the objects of the class.
7. If a new class is a subclass of a single parent class, then the Derivation process is called single inheritance. If a class has more than one parent class, the process is called multiple inheritance. When a number of classes are related through single inheritance, their relationships to each other can be shown in a derivation tree. The class relationship in a multiple inheritance can be shown in a derivation graph. One disadvantage of inheritance as a means Of increasing the possibility of reuse is that it creates a dependency Among the classes in an inheritance hierarchy.
8. Polymorphism and Dynamic Binding 3 rd characteristics of OOP language is a kind of polymorphism provided by the dynamic binding of messages to method definitions. This is supported by allowing one to define polymorphic variables of the type of the parent class that are also able to reference objects of any of the subclass of that class. The parent class can define a method that is overridden by its subclass. Virtual method , any class that includes at least one virtual method is called a virtual class. Such as class cannot be instantiated because not all of its methods have bodies.
9.
10.
11. On the other hand, keeping the implementation part of the parent class hidden from the subclasses can cause inefficiencies in the execution of the instances of those subclasses. This can be caused by the difference in efficiency of having direct access to data structures versus requiring access through the operations defined in the parent class. However, if the language designer has chosen interface inheritance, this code would look something like int second ( ) { int temp = top ( ) ; pop ( ) ; int temp_result = top ( ) ; push (temp) ; return temp_result; } This is clearly a slower process than the direct access to the second element from the top of the stack. The best solution for the language designer is to provide both implementation and interface inheritance options to the software designer and let him or her decide, on a case-by-case basis, which version is better.