Object Oriented Programming is a design philosophy or a model of programming which is different from the old Procedural programming. In Procedural Programming, a program has is viewed as a logical procedure that takes input data, processes it, and produces output data. Hence historically the main concern was how to write the logic, not how to define the data.
In programming terms these agents are your objects that have roles and provide services (responsibilities).
So now you might have a conceptual picture of what an object oriented programming is and how it works:
From above example you might have also understood one important concept of OOP: The agent (object) sending message to another agent asking for conducting some task , need not to know the means by which it’s request is carried out. This is what we call the principal of “information hiding”.
OOP provide modularity model once you change part of code which is in separate module, it will not impact any module developed in application.
When a person uses programs like C++ or Java they have a lot less code to write. This is why people praise object-oriented programming. They can shorten their programming code. This makes a cleaner program that is easier for someone else to follow.
It is also easier to organize the code. This is so important when people are working as part of a bigger team.
OOP provide Inheritances model, so your application can inherit another class which is having similarity on behavior such as the variables and its methods, but you just write the distinct behaviour for your own implementation.
OOP is a programming language model organized around "objects” that is Object-oriented programming takes the view that what we really care about are the objects.
It is claimed that the problem-solving techniques used in object-oriented programming more closely models the way humans solve day-to-day problems.
Let us take an example of how you solve your daily problems, suppose you want to send flowers to your friend whose name is Nemo on his birth day. The problem is that Nemo lives in a different city, say far-away-city.
Therefore to solve this problem you go to a flower shop which is owned by Remo. You give Remo your friend’s address and tell him the kind of flowers you want him to deliver to Nemo.
After giving the details you return back home and do not bother about the efforts that Remo is going to take in order to deliver those flowers to your friend Nemo—such information is hidden from view.
Now have a look on how your flowers actually got delivered to Nemo
Remo, the florist passed some message to another florist who lives in the same city as Nemo. That florist passed another message to his subordinate to make floral arrangements, the subordinate passes flowers and the message that you want to send to your friend Nemo to a delivery person. The subordinate may also have interacted with some message with the whole saler of the flowers, who in turn would have interacted with the flower grower.
It is claimed that the problem-solving techniques used in object-oriented programming more closely models the way humans solve day-to-day problems.
Let us take an example of how you solve your daily problems, suppose you want to send flowers to your friend whose name is Nemo on his birth day. The problem is that Nemo lives in a different city, say far-away-city.
Therefore to solve this problem you go to a flower shop which is owned by Remo. You give Remo your friend’s address and tell him the kind of flowers you want him to deliver to Nemo.
After giving the details you return back home and do not bother about the efforts that Remo is going to take in order to deliver those flowers to your friend Nemo—such information is hidden from view.
Now have a look on how your flowers actually got delivered to Nemo
Remo, the florist passed some message to another florist who lives in the same city as Nemo. That florist passed another message to his subordinate to make floral arrangements, the subordinate passes flowers and the message that you want to send to your friend Nemo to a delivery person. The subordinate may also have interacted with some message with the whole saler of the flowers, who in turn would have interacted with the flower grower.
This was how the problem got solved. There are a number of agents (you,Nemo, Remo, Subordinate, delivery person, wholesaler, flower grower etc.) in the whole process that interacted by passing messages. Every agent had a role to play and every agent also had some responsibly to conduct.
Besides every agent also has some unique state, e.g- your friend has a name, birthdate, city of residence etc. The florists also have some name, name of their shops etc. When you were sending your flowers to your friend you have to give the name of your friend to the florist, don’t you?
Besides every agent also has some unique state, e.g- your friend has a name, birthdate, city of residence etc. The florists also have some name, name of their shops etc. When you were sending your flowers to your friend you have to give the name of your friend to the florist, don’t you?
In programming terms these agents are your objects that have roles and provide services (responsibilities).
So now you might have a conceptual picture of what an object oriented programming is and how it works:
An object-oriented program is structured as community of interacting agents called objects. Each object has a role to play. Each object provides a service or performs an action that is used by other members of the community. In OOP an action is initiated by passing messages to appropriate agent (object) who is responsible for that action (provides the service, in OOP). The passed message is actually the request for conducting action (In object oriented programs you do this by invoking methods). When the message is passed appropriate additional information (like in above example:name of your friend whom to deliver the flower and what message to send with the flower) are also provided with it for successful completion of the action (in any object oriented programs these are the arguments or parameters that you pass with the message).
From above example you might have also understood one important concept of OOP: The agent (object) sending message to another agent asking for conducting some task , need not to know the means by which it’s request is carried out. This is what we call the principal of “information hiding”.
What is an object?
Objects are key to understanding object-oriented technology.
Software objects are conceptually similar to real-world objects: they too consist of state and related behavior. An object stores its state in fields (variables in some programming languages) and exposes its behavior through methods (functions in some programming languages). Methods operate on an object's internal state and serve as the primary mechanism for object-to-object communication. Hiding internal state and requiring all interaction to be performed through an object's methods is known as data encapsulation — a fundamental principle of object-oriented programming.
Software objects are conceptually similar to real-world objects: they too consist of state and related behavior. An object stores its state in fields (variables in some programming languages) and exposes its behavior through methods (functions in some programming languages). Methods operate on an object's internal state and serve as the primary mechanism for object-to-object communication. Hiding internal state and requiring all interaction to be performed through an object's methods is known as data encapsulation — a fundamental principle of object-oriented programming.
Why did OOP become a bigger picture in programming world?
Flexibility!!!!.OOP provide modularity model once you change part of code which is in separate module, it will not impact any module developed in application.
When a person uses programs like C++ or Java they have a lot less code to write. This is why people praise object-oriented programming. They can shorten their programming code. This makes a cleaner program that is easier for someone else to follow.
It is also easier to organize the code. This is so important when people are working as part of a bigger team.
OOP provide Inheritances model, so your application can inherit another class which is having similarity on behavior such as the variables and its methods, but you just write the distinct behaviour for your own implementation.