Tag: Architecture & Dependency
All the articles with the tag "Architecture & Dependency".
Event, Observer, DI, or Message Bus: The Trade-off Between Decoupling and Traceability in Unity
Over-decoupling code with global Message Buses makes bug tracing a nightmare: Evaluating architectural trade-offs between C# Events, Observers, DI, and structured communication layers.
Polling UI in Update(): When Quick Fixes Turn into Technical Debt
Polling score text and health bars inside Update() triggers needless Canvas rebuilds and CPU overhead: The hidden cost of UI polling and a clean migration path to Event-Driven MVP.
GameManager Is a Singleton and Cannot Be Touched: Handling Dependencies for New Unit Tests
Writing unit tests for new features when the legacy GameManager Singleton cannot be touched: A 3-tier decoupling strategy using wrappers, capability interfaces, and incremental service facades.
Why Large Projects Avoid Singleton Even Though It's Convenient
Singletons accelerate early prototyping but quickly become static GC roots, race condition hazards, and zombie objects. Pragmatic decoupling strategies as game projects scale.