Object Oriented Basics.

Object Oriented Programming

Object oriented programming or OOP for short is defined by how objects interact with each other. It is very common to break a large software application down into smaller and smaller components or objects

Objects can have attributes and bahaviors.

Pez Dispenser Example

  • Attributes

    1. Having a green head

    2. Having an orange body

    3. Holding 10 pieces of pez candy

  • Behaviors

    1. Dispense a Pez Candy

    2. Reload the dispenser

Objects can also be composed of other objects. Such as the head of a pez dispenser and the body of the dispenser. This lets you switch out different head and body designs with ease.

In software this benefits developers be forcing you to design the software and break it down in smaller and smaller chunks (objects). This makes building large applications eaaier and you can implement interactions with those objects one at a time. Software reuse is also another benefit, you can reuse objects that you have built in one project or file into another project or file.

OOP is pretty powerful once you wrap your head around it. Significant object-oriented languages include Java, C++, C#, Python, PHP, Ruby, Perl, Delphi, Objective-C, Swift, Common Lisp, and Smalltalk.