Object (computer science) - Your Art History Reference Guide!

ArtHistoryClub Information Site on Object (computer science) Art History Art History Search        Art History Browse welcome to our free resource site for all art history lovers!
Art History Search        Art History Browse             News        Gallery        Forums        Articles        Weblinks        welcome to our free resource site for all art history lovers!

Object (computer science)

An object is a data structure that is unique and separate from other objects, although they are able to interact with other objects.

An object is the central concept in object-oriented programming, and the term object today usually refers to an object in the OOP sense. In OOP, an object consists of two kinds of members:

  1. data members that represent the data associated with the object.
  2. methods that access the data members in predefined ways.

In the case of most objects, one can access the data members only through the method members, making it easy to guarantee that the data will always remain in a well-defined state (class invariants will be enforced). Some languages do not make distinctions between data members and methods.

A real-world example of an object would be "my dog", which is an instance of a type (a class) called "dog", which is a subclass of a class "animal". In the case of a polymorphic object, some details of its type can be selectively ignored, for example a "dog" object could be used by a function looking for an "animal". So could a "cat", because it too belongs to the class of "animal". While being accessed as an "animal", some member attributes of a "dog" or "cat" would remain unavailable, such as the "tail" attribute, because not all animals have tails.

Three properties characterize objects:

  1. identity - the property of an object that distinguishes it from other objects
  2. state - describes the data stored in the object
  3. behaviour - describes the methods in the object's interface by which the object can be used

Some terms for specialized kinds of objects include:

  • Singleton object - An object that will only allow itself to be instantiated once during the lifetime of the program.
  • Functor (function object) - an object with a single method (in C++, this method would be the function operator, "operator()") that acts much like a function (like a C/C++ pointer to a function).
  • Immutable object - an object set up with a fixed state at creation time and which does not vary afterward.
  • First-class object - an object that can be used without restriction.
  • Container object - an object that can contain other objects.
  • Factory object - an object that can create other objects.

See also

Last updated: 05-28-2005 21:58:41
Last updated: 01-04-2007 01:18:57
The contents of this article are licensed from Wikipedia.org under the
GNU Free Documentation License. See original document.
Art History Search | Art History Browse | Contact | Legal info