Encyclopedia > Object-oriented

  Article Content

Object-oriented programming

Redirected from Object-oriented

Object-oriented programming (OOP) is a software design methodology and programming paradigm that defines programs in terms of "classes of objects", objects being entities that combine both state (i.e., data) and behavior (i.e., procedures, or methods).

Table of contents

What is object-oriented programming The definitions of OOP are vague. The majority of people claim OOP should include both use of objects and some support of reusability including abstraction, inheritance, thus, some languages, known as object-based languages are generally distinguished from OOP languages.

Detail Object-oriented programming expresses a computer program as a set of these objects, which encapsulate data with function and provide regulated communicate between each other to perform tasks. This differs from traditional procedural languages in which data and procedures are separate. The objective of Object-oriented programming is componentise software in-order to make programs easier to write, maintain, reuse and prove correct.

Another way this is often expressed is that object-oriented programming encourages the programmer to think of programs primarily in terms of the data types, and secondarily on the operations ("methods") specific to those data types. Procedural languages encourage the programmer to think primarily in terms of procedures, and secondarily the data that those procedures operate on. Procedural programmers write functions, then pass data to them. Object-oriented programmers define objects with data and methods, then send messages to the objects telling them to perform those methods on themselves.

There is some disagreement about exactly which features of a programming method or language qualify as "object-oriented", but there is a general consensus that the following features are most important (each of which is explained in more detail on its own linked page):

  • Abstraction: Each object in the system serves as a model of an abstract "actor" that can perform work, report on and change its state, and "communicate" with other objects in the system, without revealing how these features are implemented. Processes, functions or methods may also be so abstracted, and when they are, a variety of techniques are required to extend an abstraction.
  • Encapsulation: Also called "information hiding", this ensures that objects cannot change the internal state of other objects in unexpected ways; only the object's own internal methods are allowed to access its state. Each type of object exposes an interface to other objects that specifies how other objects may interact with it. Some languages relax this, allowing some direct access to object internals in a controlled way, and limiting the degree of abstraction.
  • Polymorphism: References to and collections of objects may contain objects of different types, and invoking a behavior on a reference will produce the correct behavior for the actual type of the referent. When it occurs at "run time", this latter feature is called late binding or dynamic binding. Some laguages provide more static ("compile time") means of polymorphism such as C++ templates and operator overloading.
  • Inheritance: Organizes and facilitates polymorphism and encapsulation by permitting objects to be defined and created that are specialized types of already-existing objects - these can share (and extend) their behavior without having to reimplement that behavior. This is typically done by grouping objects into classes, and classes into trees or lattices reflecting common behavior.

Object-based programming techniques include the concept of an object (encapsulation, and abstraction) but do not include the object-oriented concepts of inheritance and polymorphism.

The concepts of object-oriented programming first took root in Simula 67, a language designed for making simulations, created by Ole-Johan Dahl and Kristen Nygaard of the Norwegian Computing Centre in Oslo. (Reportedly, the story is that they were working on ship simulations, and were confounded by the combinatorial explosion of how the different attributes from different ships could affect one another. The idea occurred to group the different types of ships into different classes of objects, each class of objects being responsible for defining its own data and behavior.) They were later refined in Smalltalk, which was developed in Simula at Xerox PARC, but was designed to be a fully dynamic system in which objects could be created and modified "on the fly" rather than having a system based on static programs.

Object-oriented programming "took off" as the dominant programming methodology during the mid-1980s, largely due to the influence of C++, an extension of the C programming language. Its dominance was further cemented by the rising popularity of Graphical user interfaces, for which object-oriented progamming is particularly well-suited.

Object-oriented features were added to many existing languages during that time, including Ada, BASIC, Lisp, Pascal, and others. Adding these features to languages that were not initially designed for them often led to problems with compatibility and maintainability of code. "Pure" object-oriented languages, on the other hand, lacked features that many programmers had come to depend upon. To bridge this gap, many attempts have been made to create new languages based on object-oriented methods but allowing some procedural features in "safe" ways. Bertrand Meyer's Eiffel was an early and moderately successful language with those goals, but it has now been essentially supplanted by Java, largely due to the emergence of the Internet, for which Java has special features.

Just as procedural programming led to refinements of technique such as structured programming, modern object-oriented software design methods include refinements such as the use of design patterns, design by contract, and modelling languages[?] (such as UML).

See glossary of object-oriented programming

For further reading

  • Booch, Grady. (1993) ISBN 0805353402 Object-Oriented Analysis and Design with Applications (Second Edition). Addison-Wesley.
  • Gamma, Erich, Richard Helm, Ralph Johnson, John Vlissides. (1995) ISBN 0201633612 Design Patterns: Elements of Reusable Object Oriented Software. Addison-Wesley.
  • Meyer, Bertrand. (1997) ISBN 0136291554 Object-Oriented Software Construction (Second Edition). Prentice Hall.
  • Rumbaugh, James, Michael Blaha, William Premerlani, Frederick Eddy, William Lorensen. (1991) ISBN 0136298419 Object-Oriented Modeling and Design. Prentice Hall.
  • Jacobsen, Ivar. (1994) ISBN 0201544350 Object-Oriented Software Engineering: A Use Case Driven Approach. Addison-Wesley.

External link

See also: *Software component, Interface description language, class, object, object-based programming, Object-oriented programming language, Functional programming, Procedural programming, Structured programming, Post-object programming.

All Wikipedia text is available under the terms of the GNU Free Documentation License

  Search Encyclopedia

Search over one million articles, find something about almost anything!
  Featured Article
Grand Prix

... ...

This page was created in 27.6 ms