title: Depends efficiency in FastAPI
body: <p>If you are application depends on some objects that needs to be initialized at startup, what's the point of using Depends mechanism to pass them to every route rather than create a global dict at startup?</p>
  <p>If the goal of the Depends strategy is to reduce repetitive code then why don't you just write your functions and call them the canonical way when you need them?</p>
  <p>I feel like the claimed &quot;Dependency Injection&quot; on the FastAPI documentation is just calling callables and from my point of view the real dependency injection (like Spring for example) can be achievable though the use of global dicts as beans.</p>
  <p>I feel like that this type of DI works for stateless classes/callables.</p>