What is an Object?

I Object my Lord!!!

Object? What’s that now? Well, it’s different. This term is coming from Object Oriented Programming. Well, we don’t have to be a programmer to understand this. Let’s try to understand this in simple terms.

Can you explain “What is CAR?” to a blind person? If yes, will that not be a definition of a CAR? The Image that Bling person will create, is that a real CAR? That’s just a definition. Or a Classification which will distinguish a CAR from BIKE. Agreed Right?

So, a Class is there to define something.

What if that Blind Person gets a CAR? is that real now? Of course…
Because that’s an Object which he\she can touch.

an Object is something which exists.

Let’s Simplify, An Object exists as per its definition of Class.

How will the CAR look like by the way to a blind person as per your definition of Class?

Class CAR
{
    headlight
    taillights
    FourWheels
    FourDoors
    TrunkDoor
    BonutDoor
    EngineType
    NUmberOfCylinder
    ...
}

How will a car look like in reality or as an Object? Of-course you know that :).

Can we now separate the properties vs actions?

Properties…
1. Doors
2. Headlights
3. Tyres… and the list goes on.

Actions…
1. Drive()
2. ApplyBreaks()
3. TurnLeft()… again, the list goes on.

Are you able to spot the difference between these?

Properties (or Attributes) talks about what an object contains, and actions (Functions() or Methods()) talk about what an object can do. Functions will always be followed by a small Bracket().

Thoughts: Turning Indicator’s State is a Method\Function\Action (whatever you call it). But are you Turning Indicator ON or OFF?

To Summarize, a Class is a definition of something which can exist. An object is its actual representation. A Class contains Attributes and Methods.

If you want to learn more about Object Oriented Programming, please follow the link below.
Object-oriented programming – Visual Basic | Microsoft Docs

PowerShell is a scripting language which relies on Objects. To learn more about this, follow the link below.
Why PowerShell? – BinLabs

Hope this helps.

Leave a comment

I’m Bindusar

Welcome to BINLABS, my cozy corner of the internet dedicated to IT admins and their daily encounter. Here, I invite you to join me for daily challenges with solution faced by admins using scripts. Let’s script together!

Let’s connect