Composition & Dependency Injection

Composition means building a game object out of small components that each do one job, instead of one big class inheriting from another big class. Dependency injection means handing a script the things it needs from the outside, instead of letting it go looking for them. Together they are how a Unity project stays flexible after the prototype.

More in Architecture

  1. Singletons & Managers
  2. Observer & Events
  3. State Machines
  4. Composition & Dependency Injection

All 42 topics in the Learn Unity Roadmap