When Thermos Flask was invented, it was labeled as one of the greatest inventions in the sense that how it remembers to keep hot things hot and cold things cold. The same analogy holds true for object-oriented programming (OOP). OOP is the most dramatic innovation in software development and some of its features draw parallels to that of Thermos Flask.
The primary objective of OOP is to provide clearer, reliable, and easily maintainable approach to program design. OOP involves concepts that are new to programmers of traditional programming languages, also known as procedural languages, imperative languages or problem oriented languages, such as Pascal, C, FORTRAN, etc. These concepts, such as data abstraction, encapsulation, data hiding, inheritance, overloading and polymorphism, lie at the heart of object-oriented programming. It is very important to understand that object-oriented programming is not primarily concerned with the details of the program operation; instead it deals with the overall organization of the program.
Object-oriented programming is not just another way of programming; it is a
new way of organizing programs.
In this chapter, before covering the concepts of object-oriented programming, let us have a look at procedural programming and object-oriented programming and their relative merits and demerits. The major motivation for the invention of new programming approach, object-oriented programming, was to remove the flaws of procedural programming approach. Object-oriented programming treats the data as a most critical element in the program design and does not allow it be scattered around the program. It ties the data and the functions that operate on it and protects it from the other functions.
Object-oriented programming allows decomposition of a problem into a number of entities called objects and then builds data and functions around these objects.
The typical of an object-oriented program and the relationship between the data and
Function . The data of an object can only be accessed by functions associated with it. However, function of one object can access the function of another object. The communications among functions of different objects is called messaging.
No comments:
Post a Comment