Page 17 - CA_Blue( J )_Class10
P. 17

Disadvantages of Object-Oriented Programming
                 Some of the disadvantages of object-oriented programming are:
                 •  Object-oriented program needs more lines of coding than a procedural-oriented program.
                 •  It needs more memory to execute at a high speed. Thus, its execution is slower than the conventional encoding system.
                 •  It requires intensive testing.


                     1.3 DIFFERENCE BETWEEN POP AND OOP
                                                  POP                                        OOP
                           It  divides  the  programs  into  small  parts  known  as  It divides the program into objects.
                           methods.
                           It follows a top-down approach.                     It follows a bottom-up approach.
                           It deals with algorithms.                           It deals with data.
                           It is less secure.                                  It is more secure.
                           Examples: C, Fortran                                Examples: C++, Java


                     1.4 PRINCIPLES OF OBJECT-ORIENTED PROGRAMMING
                 These are mainly four principles of the object-oriented programming paradigm. These are:
                 •  Encapsulation                                    •  Data Abstraction
                 •  Inheritance                                      •  Polymorphism
                 Let’s learn about them in detail.

                 1.4.1 Encapsulation
                 Encapsulation is one of the basic concepts in object-oriented programming. The wrapping up of data members and
                 member  methods  together  into  a  single  unit  is  called  encapsulation.  It  means  that  data  can  be  accessed  in  the
                 associated method only and is safe from outside interference and misuse, thus leading to the important concept of
                 OOP known as data hiding.

                 A real-life example is a capsule. In general, a capsule is a small case or container,
                 especially round or cylindrical in shape, which protects the drug inside it from   Methods  Variables
                 getting contaminated with the dust particles outside.

                 Similarly, methods and variables are enclosed within a unit called a class.         CLASS

                 1.4.2 Data Abstraction
                 The word abstract means existing in thought as an idea but does not
                 have  a  tangible  existence.  For  example,  while  travelling  in  a  car  as  a
                 passenger, you think only of reaching the destination. You never think
                 of how the driver is driving the car by pressing the clutch, brake and
                 accelerator as and when required. Similarly, in the case of the driver, he
                 is only concerned with the steering wheel, accelerator, clutch and brake.
                 But he is least interested in how they execute their functions.

                 Similarly,  in  object-oriented  programming,  the  key  purpose  of
                 abstraction is to hide the details that are not required from the users.
                 Data Abstraction is the property by which the essential features of a class are represented without informing about
                 the background details i.e., non-essential units are hidden from the user. The main purpose of data abstraction is to
                 reduce the complexity of a program.





                                                                                                                       15
                                                                      Introduction to Object-Oriented Programming Concepts  15
   12   13   14   15   16   17   18   19   20   21   22