Tier 4 Series 302

302E: The Modular Chassis

Pilot Record
Student Profile
"Inheritance is brittle. If you build a class tree like `Vehicle -> Aircraft -> Jet`, and then you want to make a `Flying Car`, you are stuck. Does it inherit from Car or Aircraft? A Navigator uses Composition to bolt capabilities onto a chassis."

The Concept: Composition over Inheritance

Instead of "Is A" (A Jet IS A Plane), use "Has A" (A Jet HAS Wings).

* **Interfaces:** `IDamageable`, `IFlyable`, `IDriveable`.
* **Components:** Small scripts that do one thing well (`Engine`, `Wings`, `Wheels`).
* **The Entity:** A GameObject that is just a container for these components.
Red Flag Detected

The AI Trap: "The Inheritance Tree"

You ask the AI: "Create a Flying Tank."

// AI-Generated Code: The "Diamond Problem"
class Tank : Vehicle { ... }
class Plane : Vehicle { ... }

// Audit Fail: C# does not support multiple base classes.
// You cannot inherit from both Tank AND Plane.
class FlyingTank : ???

This is "Inheritance Hell." You end up duplicating code (copying flight logic into the Tank script) because the structure forbids sharing.

Elite Telemetry

Research shows "Elite" teams achieve 15% faster lead times by keeping AI on a "very tight leash."

  • Small Batches Solving one problem at a time prevents logic drift.
  • Modular Design Localizing the "blast radius" of AI changes.
  • Tight Loops Rapid iteration with constant code review.

The Navigator's Correction

Corrective Protocol
// Corrected: Modular Composition
public class FlyingTank : MonoBehaviour {
    // The Tank HAS tracks AND Wings. It doesn't "inherit" them.
    [RequireComponent(typeof(TankTracks))]
    [RequireComponent(typeof(JetWings))]
    void Start() { ... }
}
Your Pilot Command
> A skilled Navigator directs the AI to use Composition.
Next Mission
The Event Bus