Click here to Skip to main content
11,705,610 members (46,051 online)
Click here to Skip to main content

Tagged as

OOP Explained in 90 Seconds

, 7 Nov 2013 CPOL 11.7K 7
Rate this:
Please Sign up or sign in to vote.
OOP Explained in 90 SecondsThe time it takes to read this

Object-oriented programming evolved from the combination of a few simple yet powerful concepts. This overview explains them succinctly.


Lines of code are collected into procedures and used to perform actions such as:

  • feed some data in
  • apply some processing or transformation
  • get some data out.

Data Structures

Sometimes, some of the data elements are related to some of the other data elements, and it is convenient to group them together into a data structure, which can then be manipulated and addressed as a single unit.

Procedures + Data Structures

Now our procedure can take a data structure as its input. The procedure may alter the data in the structure and/or produce another data structure as it output.

Object, Methods, and Properties

Occasionally, we notice that some procedures are only concerned with a certain kind of data structure. It is convenient to group these procedures together with their data structure, and call it an object. This allows us to refer to a data structure and all of its associated procedures as a single unit.

The procedures associated with an object are called methods.

The elements of the data structure for an object are called properties.

Class and Instance

We may find that we need a lot of objects that behave the same but have different values for their data elements. A template for creating objects is called a class. An object is said to be an instance of its class.

Message Passing and Polymorphism

If we politely request an object to do something, instead of rudely executing its procedures directly, this is called message passing – even if no actual “message” is transmitted.

The joy here is that many different kinds of objects may respond to the same message in different ways; this is called polymorphism.

For example, we can ask many different kinds of machines to Start, and each responds appropriately. We see this every day: many different machines around us have some kind of a Start button, but exactly how they go about starting themselves is entirely up to the particular machine to accomplish.

Inheritance, Superclass, and Subclass

We may notice that one class is very much like another, sharing a lot of the same data elements and procedures. So, instead of copying and pasting code we let one class inherit from another: the subclass inherits from the superclass or “base class”.

In this way the subclass has access to all of the data structures and procedures of the superclass, and can augment or override them as necessary to define the differences between the base class and the subclass.

This process is often called differential programming; it is a very powerful and convenient way to reuse code.

That’s it! These are the basic concepts of object-oriented programming (OOP) – simple, subtle, and very powerful!

Of course, they can be misused and misapplied. This is where experience and practical advice becomes extraordinarily valuable. It’s easy to learn the definitions. It’s more difficult to know how to apply them. It’s far more difficult to recognize and fix it when you have misapplied them!


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Steven A. Lowe
Founder Innovator LLC
United States United States

Steven is the founder and CEO of the consulting and custom software development company Innovator LLC (, which helps companies identify problems that can be transformed into opportunities and strategic advantages by providing innovative solutions for complex problems.

Monitor your .NET applications with CALM, the Common Application Lightweight Monitor.Customizable application monitoring for .NET written by developers, for developers. CALM provides continuous application monitoring and automatically traps and reports unhandled exceptions in .NET applications of all types.

Personal blog at

Steven is a consultant, software architect, developer, innovator, and inventor with several decades of experience in many different languages and platforms across dozens of industries.

You may also be interested in...

Comments and Discussions

QuestionThanks Pin
SamUS.NET30-Dec-14 22:03
memberSamUS.NET30-Dec-14 22:03 
GeneralMy vote of 5 Pin
M Rayhan7-Nov-13 23:47
memberM Rayhan7-Nov-13 23:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150819.1 | Last Updated 7 Nov 2013
Article Copyright 2013 by Steven A. Lowe
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid