CodingNic

Object Oriented Programming

Module Overview

Object Oriented Programming 5 min read

Module Overview

Object Oriented Programming

Everything in Python is already an object: this module teaches you to build your own. Object-oriented programming (OOP) is a way of modeling real things (a car, a deck of cards, a player) as classes with their own data and behavior.

Why This Matters

As programs grow, keeping related data and the functions that act on it scattered across a file becomes hard to reason about. OOP groups them together, which is how most real-world Python code, including the libraries you’ll eventually use, is actually organized.

What You’ll Learn

  • Core OOP concepts: encapsulation and abstraction
  • How to write your own classes, instance methods, class methods, and static methods
  • Controlling attribute access with @property, and cutting boilerplate with @dataclass
  • Inheritance, super(), and method resolution order (MRO)
  • How to define your own exception classes
  • Special “dunder” methods, polymorphism, and enforcing method implementations with abc

Outcome

By the end of this module, you’ll be able to design and write your own classes instead of representing everything as loose functions and data. The module closes with a mini project: a Library Management System built from several collaborating classes.

Let’s get started.