How do you implement and configure dependency injection in a large-scale Spring Boot or .NET application?
Implement the dependency-resolution core as a function. Given service registrations and a root service, return each required service in dependency-first order, or return an empty list when a dependency is missing or a circular dependency exists.
Each registration contains a list of dependency names and a lifetime value, either singleton or transient; lifetime is configuration metadata and does not change ordering. The input and output shapes are defined below.
def build_resolution_plan(registrations, target):