Principles of Object-Oriented Programming in C++ Language.

 Principles of Object-Oriented Programming in C++ Language.


1] Explain Software Crisis.

               Developments in software technology continue to be dynamic. New tools and techniques are announced in quick succession. This has forced the software engineers an industry to continuously look for new approaches to software design and development, and they are becoming more and more critical in view of the increasing complexity of software systems as well as the highly competitive nature of the industry. These rapid advances appear to have created a situation of crisis within the industry. The following issues need to be addressed to face this crisis:

  • How to represent real life entities of problem in system design?
  • How to design systems with open interfaces?
  • How to manage time schedules?
  • How to improve the quality of software?
  • How to industrialize the software development process?
               Many software products are either not finished, or not used, or else are delivered with major errors. This illustrates that the software industry has a remarkably bad record in delivering products. 

               In figure so the fate of the US defence software projects undertaken in the 1970s. Around 50% of the software products were never delivered, and one-third of those which were delivered were never used. It is interesting to not that only 2% were used as delivered, without being subjected to any changes.
   
               These studies and other reports on software implementation suggest that software products should be evaluated carefully for their quality before they are delivered and implemented. Some of the quality issues that must be considered for critical evaluation are:
  1. Correctness
  2. Maintainability 
  3. Reusability
  4. openness and interoperability
  5. portability 
  6. security
  7. integrity
  8. user friendliness
2] Explain Software Evolution.

              Ernest Tello, a well-known writer in the field of artificial intelligence, compared the evolution of software technology to the growth of the tree. Like a tree, the software evolution has had distinct phases or "layers" of growth. However, the analogy fails if we consider the life of these layers. in software systems, each of the layers continues to be functionable, whereas in the case of trees, only the uppermost layer is functionable.

               Alan Kay, one of the promoters of the object-oriented paradigm and the principle designer of Smalltalk, has said: "As complexity increases, architecture dominates the basic material".
Ton build today's complex software it is just not enough to put together a sequence of programming statements and sets of procedures and modules; we need to incorporate sound construction techniques and program structure that are easy to comprehend, implement and modify.

               Since the invention of the computer, many programming approaches have been tried. The primary motivation in each has been the concern to handle the increasing complexity of programs that are reliable and maintainable.

            

               These layers were built up one by one over the last five decades as shown in figure with each layer representing an improvement over the previous one.

                With the advent of languages such as C, structured programming became very popular and was the main technique of the 1980s. Structured programming was a powerful tool that enabled programmers to write moderately complex programs fairly easily. however, as the programs grew larger, even the structured approach failed to show the the desired results in terms of bug-free, easy-to-maintain, and reusable programs.

                 Object-Oriented Programming (OOP)is an approach organization and development that attempts to eliminate some of the pitfalls of conventional programming methods by incorporating the best of structured programming features with several powerful new concepts. It is a new way of organizing and developing programs and has nothing to do with any particular language. However, not all languages are suitable to implement the OOP concepts easily.

 3] Explain Procedure-Oriented Programming. 

               Conventional programming using high level language such as COBOL, FORTRAN and C, is commonly known as procedure-oriented programming (POP). In the procedure-oriented approach, the problem is viewed as a sequence of thing to be done such as reading, calculating and printing. A typical of function are written to accomplish these tasks. The primary focus is on functions.

      
               A typical program structure for procedural programming is shown figure. The technique of hierarchical decomposition has been used to specify the tasks to be completed for solving problems.

               Procedure-Oriented programming basically consist of writing a list of instructions (or actions) for the computer to follow, and organizing these instructions into groups known as functions. We normally use a flowchart to organize these actions and represent the flow of control from one actions to another. While we concentration on the development of functions, very little attentions is given to the data that are being used by various functions. What happens to the data? How are they affected by the functions that work on them? 

               In a multi-functions program, many important data items are placed as global so that they may be accessed by all the functions. Each functions may have its own local data.


                   In figure shows the relationship of data and functions in a procedure-oriented program.

              Global data are more vulnerable to an inadvertent change by a functions. In a large program it is very difficult to identify what data is used by functions. In case we need to revise an external data structure, we also need to revise all functions that access the data. this provides an opportunity for bugs to creep in.

                Another serious drawback with the procedural approach is that it does not model real world problems very well. This is because functions are actions-oriented and do not really correspond to the elements of the problem.

some characteristics exhibited by procedure-oriented programming are:
  • Emphasis is on doing things (algorithms).
  • Large programs are divided into smaller programs known as functions.
  • Most of the functions share global data.
  • Data move openly around the system from function to function.
  • Functions transform data from one from to another.
  • Employs top-down approaches in program design.

               
               in figure shows the relationships of data and functions in a procedure-oriented program.

4]  Explain Object-Oriented Programming Paradigm.

                The major motivating factor in the inventions of objects-oriented approach is to remove some of the flaws encountered in the procedural approach. OOP treats data as a critical elements in the program development and dose not allow it to flow around the system. It ties data more closely to the functions that operate on it, and protects it from accidental modification from outside functions. OOP allows decomposition of a problem into a number of entities called objects and then builds data and functions around these objects. The data of an object can be accessed only by the functions associated with that object. However, functions of one object can access the functions of other objects.

๐Ÿ‘‰Some of the striking features of objects-oriented programming are:
  • Emphasis is on data rather than procedure.
  • Programs are divided into what are known as objects.
  • Data structures are designed such that they characterize the objects.
  • Functions that operate on the data of an object are tied together in data structure.
  • Data is hidden and cannot be accessed by external function.
  • objects may communicate with each other through functions.
  • New data and functions can be easily added whenever necessary.
  • Follows bottom-up approach in program design.

               In figure the organization of data and functions in object-oriented programs.


4] Explain Dynamic Binding.
     
              Binding refers to the linking of a procedure call to the code to be executed in response to the call. Dynamic binding (also known as late binding) means that the code associated with a given procedure call is known until the time of the call at run-time. It is associated with polymorphism and inheritance. A function call associated with a polymorphic reference depends on the dynamic type of that reference.

             By inheritance, every object will have this procedure. Its algorithm is, however, unique to each object and so the draw procedure will be redefined in each class that defines the object. At run-time, the code matching the object under current reference will be called. 

5] Explain Massage Passing.

                 An object-oriented program consists of a set of objects that communicate with each other. The process of programming in an object-oriented language, therefore, involves the following basic steps:
  1.   Creating classes that defines objects and their behavior.
  2.   Creating objects from class definitions
  3.   Establishing communication among objects. 
              Object communicate with one another by sending and receiving information much the same way as people pass message to one another. The concept of message passing makes it easier to talk about building systems that directly model or simulate their real-world counterparts.

                  A massage for an object is a request for execution of a procedure, and therefore will invoke a function(procedure) in the receiving object that generates that desired result Massage passing involves specifying the name of the object, name of the function (massage) and the information to be sent.  
๐Ÿ‘‰Example:              
       
          Objects have a life cycle. They can be created and destroyed. Communication with an object is feasible as long as it is alive.

6] Explain Benefits of OOP.
      
                       OOP offers several benefits to both the program designer and the user. Object-orientation contributes to the solution of many problem associated with the development and quality of software products. The new technology promises greater programmer productivity, better quality of software and lesser maintenance cost. The principal advantages are:
  • Through inheritance, we can eliminate redundant code and extend the use of existing classes.
  • We can build programs from the standard working modules that communicate with one another, rather than having to start writing the code from scratch.
  • The principle of data hiding helps the programmer to build secure programs that cannot be invaded code in other parts of the program.
  • It is possible to have multiple instances of an object to co-exist without any interference.
  • It is possible to map objects in the problem domain to those in the program.
  • It is easy to partition the work in a project based on objects.
  • The data-centered design approach enables us to capture more details of a model in implementable form.
  • Object-oriented system can be easily upgraded from small to large system.
  • Message passing techniques for communicate between objects makes the interface description with external systems much simpler.
  • Software complexity can be easily managed.    
               While it is possible to incorporate all these features in an object-oriented system, their importance depends on the type of the project and the preference of the programmer. There are a number of issues that need to be reap some of the benefits stated above. For instance, object libraries must be available for reuse. The technology is still developing and current products may be superseded quickly. Strict controls and protocols need to be developed if reuse is not to be compromised.

                 Developing a software that is easy to use makes it hard tu build. It is hoped that the object-oriented programming tools would help manage this problem.

7] Explain Object-Oriented Language.

                   Object-oriented programming is not the right of any particular language. Like structured programming, OOP concepts can be implemented using language such as C and pascal. However, programming becomes clumsy and may generate confusion when the programs grow large. A language that is specially designed to support the OOP concepts makes it easier to implement them.

                    The language should support several of the OOP concepts to claim that they are object-oriented. Depending upon the features they support. they can be classified into the following two categories:
  1. Object-based programming language, and
  2. Object-oriented programming languages.

8] Explain application of OOP.

                     OOP has become one of the programming buzzwords today. There appears to be a great deal of excitement and interest among software engineering in using OOP. Applications of OOP are beginning to gain importance in many areas. The most popular application of object-oriented programming, up to now, has been developed, using the OOP techniques.

                     Real-business systems are often much more complex and contain many more object with complicated attributes and method. OOP is useful in these types of applications because it can simplify a complex problem. The promising areas for application of OOP include:
  • Real-time systems
  • Simulations and modeling
  • Object-oriented database
  • Hypertext, hypermedia and expert text.
  • AI and expert systems
  • Neural network and parallel programming
  • Decision support and office automation systems
  • CIM/CAM/CAD systems
                       The richness of OOP environment has enabled the software industry to improve not only the quality of software systems but also its productivity. Object-oriented technology is certainly changing the way the software engineers think, analyze, design and implement systems.
                             

Comments