OOP Basics 🌮

This is a class with the basics of OOP

This class will cover:

  • 4 pillars
    • Abstraction
    • Encapsulation
    • Inheritance
    • Polymorphism

Other learning objectives:

  • Git + Github
  • Documentation
  • Best practices of

Definitions

Class()

A class is an essential part of OOP. CA Class is like an object constructor, or a "blueprint" for creating objects. It has methods and parameters for defining objects created within the class (and any subclasses)

(self)

The self parameter is a reference to the current instance of the class, and is used to access variables that belongs to the class.

Instance of a class

Almost everything in Python is an instance/object, with its properties and methods.

Methods

Are functions that can be used by objects within a specific class

Abstraction

Is hiding complxity from the user and is exposing only useful/necessary parts to get something done

An example would be turning on a microwave using the start button. We don't need to know about the particle vibrations and resonance - We just to know our food will be warmed

Inheritance

The ability to inherit behaviour and characterisitcs from a parent class