Page 112 - 2617_JSSPS_C-7
P. 112

Principles of Object-Oriented Programming

              OOP depends on the following principles:

              1.  Data Abstraction                                                     Definition
              2.  Inheritance
                                                                    A programming model that depends on the theory
              3.  Polymorphism                                      of classes and objects and gives importance on data

              4.  Encapsulation                                     rather than functions is known  as Object-Oriented
                                                                    Programming (OOP).
              They are also called the four pillars of
              Object-Oriented Programming.

              Advantages of Object-Oriented Programming

              Following are the advantages of Object-Oriented Programming:
              1.   Each and every instance has properties that are exclusively for its own use and cannot be used by
                 other instances. For example, if you have a Car blueprint, you can create many instances of Car with
                 different model names such as Maruti Suzuki, Ford Figo and Ambassador, etc. Thus, a real-world
                 picture can be explained.

              2.   It  uses  the  concept  of  re-usability where  code is  written  once  and  can be  used  multiple  times
                 using different objects.

              3.   Maintaining  and  modifying  existing  code  is  much  easier due  to  inheritance  and  polymorphism,
                 which allow for the reuse of existing code with minimal changes.
              4.  Abstraction and Data hiding maintain the security of data.

              5.  The concept of Inheritance helps avoid data redundancy by allowing code reuse.
              Disadvantages of Object-Oriented Programming

              Following are the disadvantages of Object-Oriented Programming:
              1.  Object-Oriented program needs more lines of code than Procedure-Oriented program.

              2.   It  typically  requires  more memory to  run  and  thus,  its  execution  may be  slower  compared to
                 Procedure-Oriented Programming.
              3.  It requires intensive testing.

              4.   Proper planning  is necessary for designing  effective Object-Oriented  programs due  to their
                 complexity and structure.

              FEATURES OF OOPS


              Object-Oriented  Programming (OOP)  is a programming paradigm that uses objects, classes and
              methods to design and implement software. Some key features of OOPs are as follows:
                   Encapsulation: Encapsulation  is the concept of bundling  the data (attributes) and the methods
                 (functions) that operate on the data into a single unit, called a class. It restricts direct access to some
                 of the object’s components, which means that the internal details of how an object works are hidden
                 from the outside world. This ensures that the object controls how its data is accessed and modified,
                 promoting data integrity.




                        Premium Edition-VII
                110
   107   108   109   110   111   112   113   114   115   116   117