"Object Oriented" has clearly become the buzzword of choice in the industry. Almost everyone talks about it. Almost everyone claims to be doing it, and almost everyone says it is better than traditional function oriented design. Object oriented design is the result of focusing attention not on the function performed by the program, but instead on the data that are to be manipulated by the program. Thus, it is orthogonal to function oriented design.
Object Oriented Design begins with an examination of the real world "things" that are part of the problem to be solved. These things (which we will call objects) are characterized individually in terms of their attributes (transient state information) and behaviour (functional process information). Each object maintains its own state, and offers a set of services to other objects. Shared data areas are eliminated and objects communicate by message passing(e.g. parameters). Objects are independent entities that may readily be changed because all state and representation information is held within the object itself. Objects may be distributed and may execute either sequentially or in parallel.
Object Oriented Design is not dependent on any specific implementation language. Problems are modelled using objects. Objects have
1) Behaviour (they do things)
2) State (which changes when they do things)
For example, a car is an object. It has state: whether its engine is running; and it has a behaviour: starting the car, which changes its state from "engine not running" to "engine running"
The various terms related to object oriented design are Objects, Classes, Messages, Abstraction, Inheritance and Polymorphism.
Objects - An object is an entity able to save a state (information) and which offers a number of operations (behaviour) to either examine or affect this state. Hence an object is characterized by number of operations and a state which remembers the effect of these operations. All objects have unique identification and are distinguishable.
Classes - In any system, there shall be number of objects. Some of the objects may have common characteristics and we can group the objects according to these characteristics. This type of grouping is known as a class. Hence, a class is a set of objects that share a common structure and a common behaviour.
Messages - Conceptually, objects communicate by message passing. Messages consists of the identity of the target object, the name of the requested operation and any other operation needed to perform the function.
Abstraction - In object oriented design, complexity is managed using abstraction. Abstraction is the elimination of the irrelevant and the amplification of essentials. We can teach someone to drive any car using an abstraction. We amplify the essentials: we teach about the ignition and steering wheel, and we eliminate the details, such as details of the particular engine in this car or the way fuel is pumped to the engine
Inheritance - Inheritance is the technique that is used to build new classes from existing ones and to build object oriented class hierarchies. You can build layers of classes derived from other classes.
Polymorphism - When we abstract just the interface of an operation and leave the implementation to subclasses it is called a polymorphic operation and process is called polymorphism
Article Source: http://EzineArticles.com/?expert=Sum_Taru
No comments:
Post a Comment