← Back to context

Comment by AlexErrant

1 day ago

What does "phased" mean here? My googlefu is failing to turn up meaningful results for "phased dependency injection", and the readme is unhelpful (and probably AI-generated: "distage follows distage's architecture", lol.)

The only 2 occurrences of "phase" are comments: `// Plan phase: analyze dependencies, detect errors` and `// Produce phase: create instances`. I'm mostly familiar with DI in C#, and SimpleInjector in particular.

Does "phased" mean "we iterate the dep graph to detect lifecycle/circular dep errors"? Similar to how `.verify()` works in SimpleInjector?

https://docs.simpleinjector.org/en/latest/howto.html#verify-...

Generative progamming. The problem is solved in phases (or stages) - at first a DAG (effectively a script in a simple DSL) is produced, then it's interpreted (and there may be different ways to interpret, e.g. you may produce a graphviz file or compute some complexity metrics or validate or whatever).