{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "b11021d0",
   "metadata": {},
   "source": [
    "(oop)=\n",
    "\n",
    "# OOP Principles\n",
    "\n",
    "<!-- chapter-intro -->\n",
    "\n",
    "Classes alone do not make a program object-oriented. This chapter names and illustrates\n",
    "the four pillars of OOP — encapsulation, inheritance, polymorphism, and abstraction —\n",
    "with concrete C# examples. The goal is conceptual clarity, not deep hierarchies:\n",
    "in modern C#, you will mostly use encapsulation and interfaces. Deep inheritance is\n",
    "often a design smell.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "efff9d0e",
   "metadata": {},
   "source": [
    "<h2>Why this chapter matters</h2>\n",
    "\n",
    "OOP vocabulary is universal — every job interview and every large codebase uses these terms.\n",
    "You should be able to name the four pillars, explain them, and recognize them in code.\n",
    "That said, the industry has shifted: modern C# and Python favor composition and interfaces\n",
    "over deep class hierarchies. Knowing when *not* to use inheritance is as important as knowing how.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a000d146",
   "metadata": {},
   "source": [
    "<h2>Learning goals</h2>\n",
    "\n",
    "By the end of this chapter, you should be able to:\n",
    "\n",
    "- name and explain all four OOP pillars with a concrete example of each\n",
    "- formally define encapsulation and relate it to what was practiced in the Classes chapter\n",
    "- create a class hierarchy using `: BaseClass` and `override` / `virtual`\n",
    "- define and implement an interface or abstract class\n",
    "- explain why preferring interfaces and composition over deep inheritance is a modern best practice\n",
    "\n",
    "<h2>Chapter flow</h2>\n",
    "\n",
    "```{tableofcontents}\n",
    "```\n"
   ]
  }
 ],
 "metadata": {
  "jupytext": {
   "cell_metadata_filter": "-all",
   "main_language": "python",
   "notebook_metadata_filter": "-all"
  },
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
