Wednesday 14 November 2012

Object-Oriented Programming

Object-Oriented Programming
Object-oriented programming (OOP) is a system based on the concept of object-oriented programming paradigm. The basic idea is to encapsulate data and functions that can be applied to these data, together as closely as possible in a known object and to the outside, so that methods of foreign objects can not manipulate these data inadvertently.

Definition of Object-Oriented Programming

The definition of what is Object-Oriented Programming and the core makes up varies, and is also subject to change.

Alan Kay, the inventor of Smalltalk and the term "object oriented", defined it in the context of Smalltalk as follows:

First Everything is an object, 2nd Objects communicate by sending and receiving messages (in terms of objects), 3 Objects have their own memory (in terms of objects), 4 Every object is an instance of a class (which must be an object), 5 The class holds the shared behavior for its instances (in the form of objects in a program list), 6 To eval a program list, control is passed to the first object and the remainder is treated as its message

"1 Everything is an object, 2nd Objects communicate by sending and receiving messages (which consist of objects), third Objects have (structured as objects) to their own memory, 4 Each object is an instance of a class (which must be an object), 5 The class includes the conduct of all its instances (in the form of objects in a program list), 6 To run a program list, the execution control is given to the first object and the remaining treated as the message "

    - Alan Kay: The Early History of Smalltalk (1993)

But later Alan Kay expressed his dissatisfaction with his chosen term object orientation, this would have come to the real core issue, in his view, the messaging, short In 2003 Alan Kay gave the following definition of object-oriented programming:

    "OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things."

    "OOP to me means only messaging, local maintaining, protecting and concealing the process state and latest possible binding of all things."

    - Alan Kay: (answer to a query, 2003)

The ISO / IEC 2382-15 standard of 1999 defines the term object-oriented, however, as follows:

    "Pertaining to a technique or a programming language that supports objects, classes, and inheritance."

    "This refers to a technique or programming language that supports objects, classes and inheritance."

    - ISO / IEC 2382-15

The ISO definition is now generally regarded as too simplistic, as well as classless object-oriented languages ​​exist and also the inheritance now less importance is attached than in the 1990s.

Concepts

Compared with other programming methods used object-oriented programming new and different terms.

The individual components that make up an object-oriented program consists during its execution are called objects. The objects are there usually designed on the basis of the following paradigms:

Abstraction

    Each object in the system can be used as an abstract model of an actor can be seen, the handle orders, change report his condition and can communicate with the other objects in the system without having to disclose to how these skills are implemented (see abstract data type (ADT )). Such abstractions are either classes (in the class-based object orientation) or prototypes (in the prototype-based programming).

Class

The data structure of an object is defined by the attributes (including properties) of its class definition. The behavior of the object is determined by the methods of the class. Classes can inherit from other classes (inheritance). It inherits the class data structure (attributes) and the methods of the inheriting class (base class).

Prototype

Objects are created by cloning existing objects and other objects can be used as prototypes, and thus make their own methods available for reuse, the new objects need to define the differences from their prototype. Changes to the prototype are dynamically effective even at its derived objects.

Encapsulation

When encapsulation is known in programming hiding implementation details. On the internal data structure can not be accessed directly, but only through defined interfaces. The internal state of other objects can not read or modify objects in unexpected ways or. An object has an interface, which is determined as to be on how to interact with the object. This prevents the circumvention of invariants of the program.

Polymorphism

Ability of an identifier, depending on its use to accept different data types. Different objects can respond to the same message differently. If the assignment of a message to respond to the message only resolved at run time, this is called late binding.

Feedback

Different objects communicate via a message-response mechanism, which leads to changes in the objects, and generates new messages calls. For the coupling is as an index of the degree of feedback.

Heredity

Inheritance is simplified to a derived class, the methods and attributes of the base class also has, thus "inherits". Thus, the derived class accesses it. New types of objects can be determined on the basis of already existing object definitions. You can create new components are added or existing ones can be overlaid.

Persistence

Object variables exist as long as the objects are present and "expire" not after processing a method.

No comments:

Post a Comment