Information about Data Object

In the programming paradigm of object-oriented programming, an object is the individual run-time unit that is used as the basic building block of programs. These objects act on each other, as opposed to a traditional view in which a program may be seen as a collection of functions, or simply as a list of instructions to the computer. Each object is capable of receiving messages, processing data, and sending messages to other objects. Each object can be viewed as an independent little machine or actor with a distinct role or responsibility.

In the world of OOP (object-oriented programming), an object is an instantiation (instance) of a class. A class is only a blueprint offering a defined functionality. That functionality is actually implemented by creating an instance of that class, in form of an object. For example, a diagram of a computer monitor is a class (let's call it monitor_class). The actual computer monitor any particular computer user is looking into is an instance of that class, an object. Multiple objects of the monitor_class can be created, each using the functionality defined by the class.

Hence, in the realm of software development, to use the functionality of a particular class, an object of that class must first be created. In the same way that to a person who wanted to drive a car, a specification of a car would not be of any use; what is needed is a real car constructed from that specification.

In depth

In strictly mathematical branches of computer science the term object is used in a purely mathematical sense to refer to any "thing". While this interpretation is useful in the discussion of abstract theory, it is not concrete enough to serve as a primitive datatype in the discussion of more concrete branches (such as programming) that are closer to actual computation and information processing. Therefore, objects are still conceptual entities, but generally correspond directly to a contiguous block of computer memory of a specific size at a specific location. This is because computation and information processing ultimately require a form of computer memory. Objects in this sense are fundamental primitives needed to accurately define concepts such as references, variables, and name binding. This is why the rest of this article will focus on the concrete interpretation of object rather than the abstract one – object oriented programming.

Note that although a block of computer memory can appear contiguous on one level of abstraction and incontiguous on another, the important thing is that it appears contiguous to the program that treats it as an object. That is, an object's private implementation details must not be exposed to clients of the object, and they must be able to change without requiring changes to client code.

Objects exist only within contexts that are aware of them; a piece of computer memory only holds an object if a program treats it as such (for example by reserving it for exclusive use by specific procedures and/or associating a data type with it). Thus, the lifetime of an object is the time during which it is treated as an object. This is why they are still conceptual entities, despite their physical presence in computer memory.

In other words, abstract concepts that do not occupy memory space at runtime are, according to the definition, not objects; e.g., design patterns exhibited by a set of classes, data types in statically typed programs.

Objects in object-oriented programming

In object-oriented programming (OOP), an instance of a program (i.e. a program running in a computer) is treated as a dynamic set of interacting objects. Objects in OOP extend the more general notion of objects described above to include a very specific kind of typing, which among other things allows for:
  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, the data members can only be accessed through the methods, 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.

In almost all object-oriented programming languages, a dot(.) operator is used to call a particular method/function of an object. For example, consider an arithmetic class named Arith_Class. This class contains functions like add(), subtract(), multiply() and divide(), that process results for two numbers sent to them. This class could be used to find the product of 78 and 69 by first of all creating an object of the class and then invoking its multiply method, as follows:

1 int result = 0; // Initialization 2 arith_Obj1 = new Arith_Class(); // Creating a new instance of Arith_Class 3 result = arith_Obj1.multiply(78,69); ''// Product of 78 and 69 stored in result variable

In a language where each object is created from a class, an object is called an instance of that class. If each object has a type, two objects with the same class would have the same datatype. Creating an instance of a class is sometimes referred to as instantiating the class.

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.

A ghost is an object that is unreferenced in a program, and can therefore serve no purpose. In a garbage-collected language, the garbage collector would mark the memory occupied by the object as free, although it would still contain the object's data until it was overwritten.

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. Behavior: 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 is the only instance of its class 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: an object that can contain other objects.
  • Factory object: an object whose purpose is to create other objects.
  • Metaobject: an object from which other objects can be created (Compare with class, which is not necessarily an object)
  • Prototype: a specialized metaobject from which other objects can be created by copying
  • God object: an object that knows too much or does too much. The God object is an example of an anti-pattern.
  • Antiobjects: a computational metaphor useful to conceptualize and solve hard problems often with massively parallel approaches by swapping computational foreground and background.

See also

External links

A programming paradigm is a fundamental style of programming regarding how solutions to problems are to be formulated in a programming language. (Compare with a methodology, which is a style of solving specific software engineering problems).
..... Click the link for more information.
Object-oriented programming (OOP) is a programming paradigm that uses "objects" and their interactions to design applications and computer programs. It is based on several techniques, including inheritance, modularity, polymorphism, and encapsulation.
..... Click the link for more information.
In computer science, runtime or run time describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time).
..... Click the link for more information.
In computer science, a subroutine (function, method, procedure, or subprogram) is a portion of code within a larger program, which performs a specific task and can be relatively independent of the remaining code.
..... Click the link for more information.
An instruction is a form of communicated information that is both command and explanation'' for how an action, behavior, method, or task is to be begun, completed, conducted, or executed.
..... Click the link for more information.
In computer science, message passing is a form of communication used in concurrent computing, parallel computing, object-oriented programming, and interprocess communication. Communication is made by the sending of messages to recipients.
..... Click the link for more information.
Object-oriented programming (OOP) is a programming paradigm that uses "objects" and their interactions to design applications and computer programs. It is based on several techniques, including inheritance, modularity, polymorphism, and encapsulation.
..... Click the link for more information.
Mathematics (colloquially, maths or math) is the body of knowledge centered on such concepts as quantity, structure, space, and change, and also the academic discipline that studies them. Benjamin Peirce called it "the science that draws necessary conclusions".
..... Click the link for more information.
Computer science, or computing science, is the study of the theoretical foundations of information and computation and their implementation and application in computer systems.
..... Click the link for more information.
In computer science, primitive types — as distinct from composite types — are data types provided by a programming language as basic building blocks. Primitive types are also known as built-in types or basic types.
..... Click the link for more information.
In programming languages a data type defines a set of values and the allowable operations on those values[1]. For example, in the Java programming language, the "int" type represents the set of 32-bit integers ranging in value from -2,147,483,648 to 2,147,483,647, and
..... Click the link for more information.
Computer programming (often shortened to programming or coding) is the process of writing, testing, and maintaining the source code of computer programs. The source code is written in a programming language.
..... Click the link for more information.
Information processing is the change (processing) of information in any manner detectable by an observer. As such, it is a process which describes everything which happens (changes) in the universe, from the falling of a rock (a change in position) to the printing of a
..... Click the link for more information.
Computer data storage, computer memory, and often casually storage or memory refer to computer components, devices and recording media that retain digital data used for computing for some interval of time.
..... Click the link for more information.
reference is an object containing information which refers to data stored elsewhere, as opposed to containing the data itself. Accessing the value referred to by a reference is called dereferencing it.
..... Click the link for more information.
variable (IPA pronunciation: [ˈvæɹiəbl]) (sometimes called a pronumeral) is a symbolic representation denoting a quantity or expression.
..... Click the link for more information.
In programming languages, name binding is the association of values with identifiers. An identifier bound to a value is said to reference that value. Since computers themselves have no notion of identifiers, there is no binding at the machine language level — name
..... Click the link for more information.
In programming languages a data type defines a set of values and the allowable operations on those values[1]. For example, in the Java programming language, the "int" type represents the set of 32-bit integers ranging in value from -2,147,483,648 to 2,147,483,647, and
..... Click the link for more information.
In computer science, the object lifetime (or life cycle) of an object in object-oriented programming is the time between an object's creation (also known as instantiation or construction) till the object is no longer used, and is destructed or
..... Click the link for more information.
In software engineering, a design pattern is a general repeatable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code.
..... Click the link for more information.
In programming languages a data type defines a set of values and the allowable operations on those values[1]. For example, in the Java programming language, the "int" type represents the set of 32-bit integers ranging in value from -2,147,483,648 to 2,147,483,647, and
..... Click the link for more information.
Object-oriented programming (OOP) is a programming paradigm that uses "objects" and their interactions to design applications and computer programs. It is based on several techniques, including inheritance, modularity, polymorphism, and encapsulation.
..... Click the link for more information.
In programming languages a data type defines a set of values and the allowable operations on those values[1]. For example, in the Java programming language, the "int" type represents the set of 32-bit integers ranging in value from -2,147,483,648 to 2,147,483,647, and
..... Click the link for more information.
confusing or unclear for some readers.

Please help [ improve the article] or discuss these issues on the talk page. In object-oriented programming, the term method refers to a subroutine that is exclusively associated either with a class (called class methods
..... Click the link for more information.
class invariant is an invariant used to constrain objects of a class. Methods of the class should preserve the invariant. The class invariant constrains the state stored in the object.
..... Click the link for more information.
In programming languages a data type defines a set of values and the allowable operations on those values[1]. For example, in the Java programming language, the "int" type represents the set of 32-bit integers ranging in value from -2,147,483,648 to 2,147,483,647, and
..... Click the link for more information.
Instantiation is the process of creating a specific object which is a member or instance of a class. It involves creating a physical instance of a declared object or class.
..... Click the link for more information.
In programming languages a data type defines a set of values and the allowable operations on those values[1]. For example, in the Java programming language, the "int" type represents the set of 32-bit integers ranging in value from -2,147,483,648 to 2,147,483,647, and
..... Click the link for more information.
This article or section may be confusing or unclear for some readers.
Please [improve the article] or discuss this issue on the talk page. This article has been tagged since December 2006.
..... Click the link for more information.
In object-oriented programming, a subclass is a class that inherits some properties from its superclass.

You can usually think of the subclass as being "a kind of" its superclass, as in a "a Manx is a kind of cat", or "a square is a kind of rectangle":
  • A cat

..... Click the link for more information.


This article is copied from an article on Wikipedia.org - the free encyclopedia created and edited by online user community. The text was not checked or edited by anyone on our staff. Although the vast majority of the wikipedia encyclopedia articles provide accurate and timely information please do not assume the accuracy of any particular article. This article is distributed under the terms of GNU Free Documentation License.
Herod_Archelaus


page counter