summaryrefslogtreecommitdiff
path: root/tutorials/module_1/1_classes_and_objects.md
diff options
context:
space:
mode:
authorChristian Kolset <christian.kolset@gmail.com>2025-04-10 12:43:05 -0600
committerChristian Kolset <christian.kolset@gmail.com>2025-04-10 12:43:05 -0600
commitaa047a8826c03a38f0325353396ed95966c07d21 (patch)
tree24f590f7054e1521eea78661dde3050eb6f02f2a /tutorials/module_1/1_classes_and_objects.md
parent9f7b779155387fbd309f1c07b7c7b4c6811a747c (diff)
Updated module 1
Diffstat (limited to 'tutorials/module_1/1_classes_and_objects.md')
-rw-r--r--tutorials/module_1/1_classes_and_objects.md45
1 files changed, 42 insertions, 3 deletions
diff --git a/tutorials/module_1/1_classes_and_objects.md b/tutorials/module_1/1_classes_and_objects.md
index 0392483..ec85633 100644
--- a/tutorials/module_1/1_classes_and_objects.md
+++ b/tutorials/module_1/1_classes_and_objects.md
@@ -1,8 +1,47 @@
# Modular Programming
-Classes and Objects
+## 1. Introduction
-## What are they?
+- A. What is Object-Oriented Programming?
+- B. Why use OOP? (vs. procedural)
+- C. Real-world analogies (e.g., modeling components like pumps, motors, or vehicles)
+---
+## 2. Core OOP Concepts
+- A. **Classes and Objects**
+ - Definitions
+ - Syntax in Python
+- B. **Attributes and Methods**
+ - Instance variables
+ - Functions inside classes
+- C. **Encapsulation**
+ - Public vs private variables
+ - Using `__init__` and `self`
+- D. **Inheritance**
+ - Parent and child classes
+ - Reuse and extension of code
+- E. **Polymorphism** _(brief overview)_
+ - Method overriding
+ - Flexibility in interfaces
+
+---
+## 3. Python OOP Syntax and Examples
+- A. Define a simple class (e.g., `Spring`)
+- B. Instantiate objects and use methods
+- C. Show `__init__`, `__str__`, custom methods
+- D. Add a derived class (e.g., `DampedSpring` inherits from `Spring`)
+
+---
+## 4. Engineering Applications of OOP
+- A. Modeling a mechanical system using classes
+ - Example: Mass-Spring-Damper system
+- B. Creating reusable components (e.g., `Material`, `Beam`, `Force`)
+- C. Organizing simulation code with OOP
+
+---
+## 5. Hands-On Coding Activity
+- A. Write a class for a basic physical component (e.g., `Motor`)
+- B. Add behavior (e.g., `calculate_torque`)
+- C. Extend with inheritance (e.g., `ServoMotor`)
+- D. Bonus: Integrate two objects to simulate interaction
-## Why do we care?