DEV Community

Cover image for OOP, OOD, and OOA in Python Intro
David Mebo
David Mebo

Posted on

OOP, OOD, and OOA in Python Intro

The definition of an object is no different from an object in real life: a tangible thing one can touch, feel, sense, and manipulate.
Things are different in programming. Objects might not be tangible, and cannot be sensed or felt, but they are models that can do certain things and vice-versa.
Short of it, An object is a collection of data.

Now that we know what an object is, what about object-oriented?
Breaking it down (because that's what we mostly do), oriented, according to the dictionary means direct towards. Piecing both the definitions of an object and oriented, we can say that Object-oriented programming means writing code directed towards moving objects

via Gfycat

Yeah... doesn't make sense, I get it.
The less confusing definition is below;

Object-oriented programming (OOP) is seen as the process of converting a design into a
working program or application that does what it is told to do.

There are more concepts to Object-oriented, like object-oriented design and object-oriented analysis. Don't worry, they are still object-oriented.

Object-oriented Paradigms

Object-oriented analysis(OOA):
This is the process of looking at a problem and identifying the objects and the interactions between the said objects.
This stage is about what needs to be done.

Example;

As a food scientist, I need a website to help users know how much to eat without it becoming a health risk to themselves.

As a visitor, here is what I would like or think is essential for visitors.
Each necessity a visitor wants is highlighted in bold text to signify that it is an object, and the actions of the visitors are in italics:

  • browse food choice
  • upload food decisions for the day/week
  • see recommended foods

You get the idea...
Once analysis/research has been carried out, we move on to the next stage.

Object-oriented design (OOD):
This is the process of taking the results of the analysis above and implementing them. It's at this point does the programmer comes up with wicked-looking names for the objects, defines their expected behavior, and specifies certain behaviors of the objects. Kinda like them team meetings I hear about, starts good, but never end well. Ah well, moving on.

Last is Object-oriented Programming (scroll up for the definition if you missed it)... aaand we are done (not) with this bit. It looks confusing (trust me, I got lost learning for the first time) but over time, you'll get over it. On that note, look out for the next part!

Top comments (0)