{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "b11021d0",
   "metadata": {},
   "source": "(oop)=\n\n# OOP Principles\n\nClasses alone do not make a program object-oriented. This chapter names and illustrates the core object-oriented principles: encapsulation, inheritance, polymorphism, and abstraction, with concrete C# examples.\n\n- **Encapsulation**: Objects protect their internal state and expose a controlled public surface.\n- **Inheritance**: A derived class can reuse and specialize behavior from a base class.\n- **Polymorphism**: Code can work with a general type while runtime objects provide specific behavior.\n- **Abstraction**: Interfaces and abstract classes describe capabilities without committing to one implementation.\n- **Composition**: Modern C# often favors combining small objects over building deep inheritance trees.\n\nThe goal is conceptual clarity and practical design judgment, especially knowing when interfaces and composition are cleaner than deep hierarchies.\n"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": "<h2>Video</h2>\n\n```{eval-rst}\n.. youtube:: PmKlPGp0O5w\n   :width: 560\n   :height: 315\n```\n\n> *[C# for Beginners – Lesson 15: Inheritance, Polymorphism & Abstraction](https://youtube.com/watch?v=PmKlPGp0O5w)* by Mike's Code.\n>\n> This video remains hosted on YouTube and is the property of its original creator or rightsholder; it is embedded here via YouTube's official player for educational reference only.\n",
   "id": "intro-video"
  },
  {
   "cell_type": "markdown",
   "id": "learning-objectives",
   "metadata": {},
   "source": "<h2>Learning Objectives</h2>\n\nBy the end of this chapter, you will be able to:\n1. Explain the four major object-oriented principles with concrete examples\n2. Relate encapsulation to the class design practiced in the Classes chapter\n3. Create a small inheritance hierarchy with base and derived classes\n4. Use overriding or interfaces to support polymorphic behavior\n5. Explain why composition and interfaces are often preferred over deep inheritance\n"
  },
  {
   "cell_type": "markdown",
   "id": "chapter-flow",
   "metadata": {},
   "source": "<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
}
