object orientated programming (OOP)

Well… yes. This might take longer than I have really. And you don’t really want to read a ten volume encyclopedia?

What is it? I thought I knew. In the halcion days of my development career, I used this programming model, without even knowing it.

Ok, well it’s a way of organising and designing software around data (objects), as opposed to just creating the functions and the procedures to do the work.

It does involve creating classes, objects, attributes, and methods. These we can see as sort of building blocks of OOP.

BUT the focus of this “brain fart”, is to state the main principles around OOP.

OK… here they are:

  • Abstraction
    So, this means that an object can have internal methods or procedures that can only be used when inherited by other objects. That means the class that inherits from the object has access to these functions / methods and so can use them. More importantly the abstracted object has the central location of the logic within the inherited functions / methods.
  • Polymorphism
    Objects can be designed to share common behaviours, and they can morph into new objects. It comes from the Greek and means “many shapes”. SO, you can create a base class with the common methods, then any child classes that are derived from that “master class” can “override” them. So, inherit the same name for the method but do something different. You don’t have to inherit them though, if called through the inherited class, it will run the definition on the “master class”.
  • Inheritance
    So with this you can create new classes, that will modify or extend the behaviour in other classes. It looks like the “child class” (or derived class) inherites all the members (like functions etc) by default. The derived class can reuse the code in the base class automatically. Except the constructures or finalisers (apparently).
  • Encapsulation
    This is when all the important information is contained inside the object and only selected information is exposed. Other objects are permitted only to call the publicly exposed functions or methods.

Ok, thats by no means an impressive list or accurate. But I’m putting it down in black and white. Please free to correct! 🙂
I’m also going to have a go at trying all this. Will publish the results.

Leave a Reply

Your email address will not be published. Required fields are marked *