Page 14 - DCAP404 _Object Oriented Programming
P. 14

Unit 1: Review of Object-oriented Programming




          Major features required by object-based programming are:                              Notes
          1.   Data encapsulation.
          2.   Data hiding and access mechanisms.
          3.   Automatic initialization and clear-up of objects.

          4.   Operator overloading.
          Languages that support programming with objects are said to be object-based programming
          languages. These do not support inheritance and dynamic binding ADA is a typical example
          Object oriented programming incorporates all of objects-based programming features along
          with two additional feature, namely, inheritance and dynamic binding. Thus

          Object oriented programming = Object-based features + inheritance + dynamic binding.
          Languages that support these features include C++, Small talk, Java among others.




              Task  In a group of four explain how language that is specially designed to support the
             OOP concepts makes it easier to implement them.

          1.3 Comparison between Procedural Programming and
               Object-oriented Programming Paradigm

          Computer programming has been around for some decades now. The style  and manner in
          which people have been developing programs itself has undergone a sea change. In the early
          days of computer development programming was looked upon as some kind of black magic –
          to be understood only by a few wizards mostly the people who had designed the computer.
          However, the entire scenario has changed now.
          In the modern programming parlance, at least in most of the commercial and business applications
          areas, programming has been made independent of the target machine. This machine independent
          characteristic of programming has given rise to a number of different methodologies in which
          programs can  now  be  developed. We will particularly concern ourselves  with two  broad
          programming approaches – or paradigm as they are called in the present context.

          1.   Procedure-oriented paradigm
          2.   Object-oriented paradigm

          1.3.1 Procedure-oriented Programming Paradigm

          Before you get into OOP, take a look at conventional procedure-oriented programming in a
          language such as C. Using the procedure-oriented approach; you view a problem as a sequence
          of things to do  such as reading, calculating and printing. Conventional programming using
          high-level languages is commonly known as procedure-oriented programming.

                 Example: COBOL, FORTRAN and C

          You  organize the  related data  items into  C structures  and  write  the necessary  functions
          (procedures) to manipulate the data and, in the process, complete the sequence of tasks that
          solve your problem.





                                           LOVELY PROFESSIONAL UNIVERSITY                                    7
   9   10   11   12   13   14   15   16   17   18   19