PDF Google Drive Downloader v1.1


Report a problem

Content text CSU4301 session 2_watermark.pdf

17 Session 2 Object Oriented Programming Content Introduction, p9 2.1 Styles of Programming, p9 2.2 Evolution of New Paradigm, p11 2.3 Procedure Oriented Programming, p11 2.4 Object Oriented Programming (OOP), p13 Summary, p14 Learning outcomes, p14 Introduction A sequence of development steps should precede the implementation task for any significant application. The development of non-trivial software products is a complex task. The complexity manifests itself in the understanding of detailed customer requirements, as well as specific analysis, design and implementation techniques that are necessary to produce a high quality software product. In designing such a product the selection of programming technique and suitable languages depend on the programmer‘s interest and the complexity of the problem. There are two main programming techniques such that Procedure Oriented Programming and Object Oriented Programming. The former technique gives more emphasis on functions of the program while the latter concerns the data. This section discusses how Object Oriented Programming is a revolutionary approach in developing computer applications. To properly understand any change of this magnitude, it is best to begin with an understanding of what is being changed. The traditional programming style, known as Procedure Oriented Programming, is where the change begins. 2.1 Styles of Programming Each programming language enforces a particular style of programming. The way of organizing information is influenced by its style of programming and it is known as programming paradigm. First generation programming languages such as FORTON I, ALGOL58, etc. were used for numeric computations. Any program makes use of data. Data is represented by a variable or a constant in a program. To perform an action, an operator acts on the data. Operands and operators are combined to form expressions. Each instruction is written as a statement with the help of expressions. A sequence of statements


20 Figure 2.4: Typical structure of procedure oriented programs While we concentrate on the development of functions very little attention is given to the data that are being used by various functions. In a multi-functioned program many important data items are placed as global, so that they may be accessed by all the functions. This is a critical problem in procedural oriented programming. That is because, suppose a new programmer is hired to write a function to analyze data in certain way. Unfamiliar with the subtitles of the program, the programmer creates a function that accidently corrupts data. This can be happened easily because every function has complete access to the data. In the same way, global data can be corrupted by functions that have no business changing it. Another problem is that, since many functions access the same data, the way the data is stored becomes critical. The arrangement of data cannot be changed without modifying all functions that access it. If you add new data items, you will need to modify all functions that access the data so that they can also access these new items. It will be hard to find all such functions, add even harder to modify all of them correctly. Each function may have its own local data. In large programs it is very difficult to identify what data is used by which function. Another problem is that in case we need to revise an external data structure we should also revise all functions that access data. This increases the probability of having bugs. Another serious drawback with the procedural approach is that it does not model real world problems very well. This is because functions are action oriented and do not really corresponding with the elements of the problem. Some features of 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 moves openly around the system from function to function  Functions transform data from one form to another  Employs top down approach in program design Main Program Function 1 Function 2 Function 3 Function 4 Function 5

Related document

x
Report download errors
Report content



Download file quality is faulty:
Full name:
Email:
Comment
If you encounter an error, problem, .. or have any questions during the download process, please leave a comment below. Thank you.