OOP with NO "S"

Updated: Mar 8, 2021

OOP – Object Oriented Programming

Written for a bachelor's degree Programming class

This is a difficult subject to adequately explain in a simple way. Object-Oriented Programming (OOP) is a way to write an application using independent pieces or blocks of code that interact with each other. The code is defined in Classes that describe Objects and the Methods that work on those Objects. With OOP the application doesn't have to execute as a series of steps that take place one after another. It is event-driven instead of code-driven and is able to respond to actions by the user. Instead of the user is subject to the code, the code exists to serve the user.

An example of an application that uses OOP would be Microsoft Word, Excel, or any of the applications appearing in the Microsoft Suite of applications. OOP allows the applications to use tool-bars containing icons where some of those icons are exactly the same from application to application. For instance, we can see the FILE OPEN or File SAVE icon in each application. That tool-bar icon is known as an object. The code for this icon is encapsulated meaning it has code and variables associated with it that the rest of the application doesn't need to know. The code associated with that icon or button just sits there and does nothing until we click on it. When we click on the button the Click() method code makes something happen. Not only can the button be reused over and over without having to write the code all over again, but the Click() method can be reused over and over as well.

A real-world example of OOP would be a car. There are a series of individual objects associated with a car that the car manufacturer uses but doesn't have to know how to make. One of those objects is a stereo player. The carmaker doesn't have to know how to build a CD/Stereo player. The only thing the automaker has to do is make a space for it in the car where it will fit properly and hook up the power and antennae inputs and the speaker outputs. There are hundreds of objects on a car like that such as a light bulb or headlight. There just needs to be a place for it but the automaker doesn't need to construct a light bulb. It already exists and can be used in many different types of cars.

In the end analysis, the way we comprehend and deal with life and this world is object-oriented. We see the world around us as objects. When we see another person we don't see their individual pieces. Instead, we see them as a whole person, a complete object. We don't tend to break things apart into their components to utilize them. For example, when we talk to each other we don't have to concentrate on our mouth and how it makes a sound or the other person's ear and how it works. We would look pretty silly in conversation if we had to think about those things.

No, the way we were built frees us up to think about what we are saying and to be able to be aware of the other person's response. The human body is a wonderful example of Object Oriented Programming or OOP; we just emulate it in computer programming. So when we write an application, OOP enables us to take objects that other people have written code for and use those objects in our application without having to understand the code behind those objects.

There is almost no easy way to describe this and when I first started writing this I was really struggling to describe it. But after I wrote the analogy between OOP and the auto-making process and then the human body it all began to make sense to me.​

© copyright 2021 h mark taylor

2 views0 comments

Recent Posts

See All

Technical Skill: High OpenVPN - how to do IT Skip to Instructions Be "somewhat" safe online by using a VPN (virtual private network). This protects you, to some degree, while you are on the Internet.

Technical Skill: Easy The Issue When I upgraded to High Sierra, I began to have problems with my USB 3 external drives constantly disconnecting. The Energy Saver settings had no effect. The Fix Afte