OOP Concept

OOP Concept

OOP Concept

Building blocks of OOP Concepts

1. Object

An object can be considered a “thing” that can perform a set of related activities . The set of activities that the object performs defines the object’s behavior. For example- The hand can grip something or a Student(object) can give the name or address.. An object is a run time entity which have properties and methods in pure OOP terms an object is an object is an instance of a class.

2. Class

A class is simply a representation of a type of object. A class is the blueprint from which which the individual objects are created. Class is user defined data type which have variable and function In fact a variable of a class type.Variable of a class is called date member and function of a class called member function.

The OOP programming depends on four main properties.

1. Encapsulation

Encapsulation is the mechanism that binds together code and data it manipulates, and keeps both safe from outside interface and misuse.In an object oriented language, code and data may be combined in such a way that a self “black box ” is created. When code and data are linked together in this fashion, an object is created. In other words, an object is the device that supports, encapsulation.within an object, code, data may be private to that object or public. Private code or data is known to and accessible only by another part of the object. That is, private code or data may not be accessed by a piece of the program that exist outside tech object. When code or data is public, other parts of your program may acceded it even though it is defined within an object. Typically, the public parts of an objects are used to provide a controlled interface to the private elements of the object. For all intents and purposes, an object is a variable of a user defined type. It may seem strange that an object that an object that links both code and data can be thought of as a variable. However, in object-oriented programming, this is precisely the case. Each time you define a new type of object, you are creating a new data type is a compound variable.

2. Data Abstraction

Abstraction refers to the act of representing essential features without including the background details of explanations. Classes use the concepts of abstraction and are defined as a list abstract attributes such ad size, wight and cost, and functions to operate on these attributes.They encapsulate all the essential properties of the objects that are to be created.Since the classed use the concept of data abstraction, they are known as Abstract Data Types(ADT).

3. Polymorphism

Object Oriented Programming languages support polymorphism, which is characterized by phrase ” one interface, multi pal method. In simple terms, polymorphism” is the attribute that allows one interface to control access to a general class of actions, The specific action selected is determined by the extract nature of the situation. A real-world example of polymorphism is a thermostat . No matter what type of furnace your house has(gas, oil, electronic, etc.),the thermostat works the same way.In this case, the thermostat(which is the interface) is the same no matter hat type of furnace(method) you have. For example, if you want a 70 degree temperature, you set the thermostat to 70 degrees. It doesn’t matter what type of furnace actually provides the heat. The first Object Oriented Programming languages were interpreters, so polymorphism was, of course, supported at run time. However,C++ is a compiled language.Therefore, in C++,both run-time and compile-time polymorphism are supported.

4. Inheritance

Inheritance is the process by which one object can acquire the properties of another object. This is important because it supports the concept of classification.If you think about it, most knowledge is made manageable by hierarchical classifications.For example, a Red Delicious apple is part of the classification apple,which in turn is part of the fruit class, which is under the larger class food. Without the use of classifications, each object would have to define explicitly all of its characteristics .However, through the use of classifications, an object need only define those qualities that make it unique within its class.It is the inheritance mechanism that makes it possible.

Application of OOP Concept

OOP has become one of the programming buzzwords today. There appears to be a great deal of excitement and interest among software engineers in using OOP. Application of OOP is beginning gain importance in many areas.
The most popular application of an object oriented programming, up to now, has been in the area of user interface Designs such as windows. There are hundreds of windows using book systems developed using OOP techniques.
•The real Time Systems
•Simulation and modeling
•Object-oriented databases
•Hyper text, hypermedia and export-text
•AI and export system
•Natural Networks and parallel programming
•Decision support and Office Automation Systems
•CIM/CAM/CAD systems

Advantage of OOP Concept

OOP offers several benefits to both the program designer and the user. Object orientation contributes to the solution of many problems associated with the development and quality of the software produce. The new technology promises better programmer productivity, better quality of software and leaser maintenance cost.
The principal advantages of OOP are:
1. Through inheritance, we can eliminate redundant code and extended the use of existing classes.
2. We can build program from the standard working modules that communicate with one another, neither then having to start writing the code from scratch. This leads to saving of development time and higher productivity.
3. The principal of data help the programmer to build secure programs that cannot be invaded by code in other parts of the program.
4. It possible to have multiple instance of an object to co-exist without any interface.
5. It is possible to map object in the problem domain to those objects in the program.
6. It is easy to partition the work in a project best on object.
7. The data-centered design approach enables us to capture more details of model in implement able from.
8. Object-oriented systems can be easily upgraded to small to large systems.
9. Message passing techniques for communication between objects makes the interface description width external systems much simpler.
10. Software complexity can be easily managed.
While it is possible to incorporate all these features in an object oriented system, their importance depend on the type of the project and the preference of the programmer. There are a number of issues brought that need to be tracked to reap some of the benefits stated above. For instance, object libraries may be supported quickly. Strict controls and protocols need to be developed if reuse is not to be compromised. Developing software is easy to you what makes it hard to his built. It is hoped his that the object oriented programming tools would help manage this problem.

Message communication

An object oriented program consists of a set of objects that communicate with each other. The process of programming is an object oriented language therefore involves the owning basic steps.
1. Creating classes that define objects and their behavior.
2. Creating objects from class definitions.
3. Establishing communication among objects
Objects communicate with one another by sending and receiving information watching the same way as people pass message to one another. The concept of masses passing makes it easier to talk about billing systems that directly model or simulate their real word counterparts. the masses for an object is a request for execution of a procedure, and therefore will invoke a function (procedure) in the receiving object that generates the desired result. Message passing involves the specifying the name of the object, the name of the function and the information to be sent.

Dynamic binding

Binding refers to the linking of a procedure call to the code associated with a given procedure call is not known until the time of the call at run-time. It is associated with polymorphism and Inheritance. A function call associated with a polymorphic reference depends if on the dynamic type of the reference.

Leave a Reply

Your email address will not be published.