Full Transcript

Principles of Object-Oriented Programming 1.1Software Crisis:- The rapid development in s/w engineers forced the s/w industry and s/w engineers to continuously look for new approaches s/w design and development. These rapid advances appear to have created a serious crisis with in th...

Principles of Object-Oriented Programming 1.1Software Crisis:- The rapid development in s/w engineers forced the s/w industry and s/w engineers to continuously look for new approaches s/w design and development. These rapid advances appear to have created a serious crisis with in the industry. The following issues need to be resolved to overcome this crisis. - How to represent real-life entities of problems in system design? - How to design systems with open interfaces? - How to ensure reusability & extensibility of modules? - How to develop modules that are tolerant to any changes in future? - How to improve s/w productivity & decrease s/w cost? - How to improve the quality of s/w? - How to manage time schedules? - How to industrialize the s/w development process? Many studies & reports on s/w implementation suggest that s/w products should be evaluated carefully for their quality before they are delivered & implemented. Some of the quality issues that must be considered for critical evaluation are: 1  Correctness  Maintainability  Reusability  Openness  Portability  Security  Integrity  User friend lines 1. 2 Software Evolution The s/w evolution can be describing it as a tree. The s/w evolution has had distinct phases or layers of growth. These layers were built up one by one. With each layer representing an improvement over the previous one. Fig. (1.1) had shown layers of s/w. 1,0 Machine language Assembly language Procedure programming Object oriented programming Fig. (1.1) layers of s/w technology 2 In s/w system, each of the layers continues to be functional, whereas in the case of trees, only the uppermost layer is functional. Since the invention of the computer, many programming approaches have been tried. These included techniques such as modular programming, top-down programming, bottom-up programming and structured programming. The primary motivation in each case has been the concern to handle the increasing complexity of programs that are reliable & maintainable. These techniques became popular among programmers over the last two decades. With the advent of languages such as C, structured programming become 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. Object-Oriented Programming (OOP): - Is an approach to programs 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. 1.3 Procedure–Oriented Programming Conventional programming using high level languages (COBOL, FORTRAN and C) is commonly known as procedure oriented programming. In the procedure-oriented approach, the problem is viewed as a sequence of things to be done, such as reading, calculating and printing. A number of functions are written to accomplish these tasks. A typical program structure for procedure programming is show in fig. (1.2). 3 Main Program Function-1 Function-2 Function-3 Function-4 Function-5 Function-6 Function-7 Function-8 Fig. (1.2) Typical structure of procedure oriented programs Procedure-oriented programming basically consists of writing a list of instructions 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 action to another. In multi-function program, many important data items are placed as global so that they may be accessed by all the functions. Each function may have its own local data. Fig. (1.3) shows the relationship of data and functions in a procedure-oriented program. Global Data Global Data Function-1 Function-1 Function-1 Local data Local data Local data Fig. (1.3) Relationship of data and functions in procedural programming. 4 Disadvantage of Global data  Global data are more vulnerable to an inadvertent change by a function.  In a large- program it is very difficult to identify what data is used by which function.  When we need to revise an external data structure , we should also revise all function that access the data. Drawback of procedure approach is that it does not model real world problems very well. Because the functions are action-oriented and do not really correspond to the elements of the problem. Characteristics exhibited by procedure-oriented programming 1- Emphasis is on doing things (algorithms). 2- Large programs are divided into smaller programs known as “functions”. 3- Most of the functions share global data. 4- Data move openly around the system from function to function. 5- Function transforms data from one form to another. 6- Employs top-down approach in program design. 5

Use Quizgecko on...
Browser
Browser