ELEMENTARY CONCEPTS OF OBJECTS

In this world, we see several objects around us. The chair on which you sit is an example of an object. The objects which you see around yourself may be living or non-living. Whatever may be the situation you will find two unique features of an object namely characteristics and behaviour. For example, a car, it's characteristic is represented by its colour, it's length and breadth, several people that can sit, the wheel radius and it's behaviour is the speed, how fast it can go from one place to another, the amount of steering control it has, whether the drive is smooth or not.


OBJECTS

We can define an object as an entity with certain characteristics and behaviour. 
In fact, all objects have their own individuality and are distinguishable. For example, you have two identical pens with the same colours, texture, shape and size, yet they are two distinguishable pens.
Programming using objects promotes an understanding of the real world and provides a practical basis for computer implementation.


OBJECT ORIENTED PROGRAMMING

Programming is a process by which we give instructions to the computer to do a particular task. There are different techniques and technologies involved in writing a program. One such technique is Object-Oriented Programming.
Object-Oriented Programming (or OOP) is a technique of implementing programs which are organised as a co-interactive collection of objects, each of which represents an instance of a class. 
Thus through the OOP technique, it is possible to represent objects having characteristics and behaviour. It forms a powerful technique to represent an object as in the real world. 


CHARACTERISTICS OF OOP

Now that you have learnt object-oriented programming let us learn the principle upon which it is based:
  • Abstraction
  • Encapsulation
  • Polymorphism
  • Inheritance 
Abstraction

Abstraction refers to the art of hiding the complexities and giving a simple interface. For example, a man has to credit some money from an ATM, he can simply follow the instruction given in the ATM screen, besides the technical coding behind the ATM's functionality. This is what is required for programming; all the complexities should be encapsulated in such a way that a simpler interface is given and hence for the programmer can carry on with the development process at the higher level so that abstraction is obtained leading to the solution of the real processes thus we can definitely tell that encapsulation leads to abstraction.



ENCAPSULATION

The term encapsulation refers to the act of enclosing one or more items within a physical or logical container. In software, terms encapsulation bind together characteristics and behaviour of an object. The characteristic is represented by data and behaviour is represented by function or method. Thus encapsulation is a technique that binds together function and the data into a single unit. To relate this to the real world consider any switchboard it encapsulates several wires for different electrical or electronic appliances to as the user have only one method of affecting this complex encapsulation.
Thus, the term abstraction is used to define the outer layout used in terms of design and the term encapsulation is used to define the inner layout used in terms of implementation.


POLYMORPHISM

The term Polymorphism is actually a combination of two terms Poly and Morphism, poly means many and morphism means forums. It is the ability to assume different forms and object-oriented programming this refers to the ability of objects to have many methods of the same name but each one responds to a different type of specific behaviour as they have different forms.

For example, in a room stands a mouse a cat and dog now from the far corner of the room there happens to be a screeching sound the mouse the cat and dog immediately turned towards the direction of the sun the dog barks the cat which is it state and the mouse next the air does you can see for the same screeching sound the animal behave differently in other words the animal behave differently for the same effect this is exactly what polymorphism is.


INHERITANCE

In the real world, you must have seen inheritance. Inheritance is a term that is used to establish a relationship using hierarchical classification it is basically a term that is used to represent the hierarchical relationship of generalization. For example, the generalization of the term mammal may have several levels of sub generation.
Inheritance is the ability of objects to establish a relationship using hierarchical classification.
In OOP the technique of inheritance is generally used for facilitating reusability. For example, a developer after modelling system tries to group similar classes together and reuses common code. Often code is available from past work which the developer can reuse and modify, when necessary, to get the precisely desired behaviour. Thus inheritance also reduces the hazard of rewriting code, thus simplifying the task of a developer.


CLASS

The implementation of encapsulation is done through a class. A class defines the structure and behaviour that will be felt by a set of objectives. Each object of a given class contains the structure and behaviour defined by the class as if it were stamped out by a mould in the shape of a class. For this reason, objects are sometimes referred to as instances of classes. Thus a class is a logical construct (a blueprint) and an object is a physical reality.


These all were some of the fundamental behaviour of a Programming Language. Hope these all helped you.

...Thank you...

Comments

Archive

Contact Form

Send