Aug 5, 2026

Aegis: Why a 21-Service Framework Keeps Unity Projects Maintainable

The architecture behind a service-oriented Unity framework — dependency injection, module installers, and lifecycle management that scales with your game.

UnityArchitectureFrameworks

Aegis is a 21-service service-oriented Unity framework I architected from the ground up to solve a fundamental problem: how do you build Unity projects that stay maintainable as they grow? The answer was a dependency-injection container with a service locator pattern, module installers for clean composition, and a full lifecycle management system that gives every service predictable startup and shutdown behavior.

Clean composition at scale

The DI container architecture uses a hierarchical registration system — core services (logging, configuration, scene management) are registered at the application level, while gameplay-specific services are scoped to individual scenes or modules. The service locator pattern provides a clean resolution API without coupling consumers to the container implementation, making it easy to swap implementations for testing or platform-specific builds.

Module installers follow a convention-over-configuration approach: each installer declares its dependencies, registers its services, and configures bindings in a single entry point, keeping the project’s composition root explicit and auditable.

Taming UI state chaos

One of the framework’s standout features is the UI attention orchestration system. It manages shell screens, modal dialogs, popups, first-time user experiences, and fly-to-HUD animations through a single attention manager that queues and prioritizes UI requests. This eliminates the spaghetti code that typically plagues UI state management in Unity projects — no more competing modal dialogs, no more z-fighting popups, and no more manual state tracking across scattered MonoBehaviour scripts. The system supports priority-based preemption, animation callbacks, and a history stack for back-navigation.

Testability by design

The test architecture enforces SOLID principles through 53+ automated tests organized into unit tests (service resolution, lifecycle contracts), integration tests (module composition, cross-service communication), and scene tests (full initialization sequences). Tests run in both edit mode and play mode, with mock implementations injected via the DI container to isolate test targets. A custom test harness validates that every service implements the required lifecycle interfaces and that no service throws during initialization.

Aegis proves that investment in architecture pays dividends in velocity — the very reason structured systems win as complexity grows.

Enjoyed this? Let's talk

I bring the same structured approach to every project. Let's discuss how I can help with yours.

Get In Touch →