service locator - Solar-AS/DI-IoC GitHub Wiki

Service Locator

  • A service locator knows now to find (and create) every dependency needed in the system.

  • This knowledge is provided by someone else at another moment of the application lifecycle.

  • Contextual information can be passed onto the SL for it to provide the correct implementation of a given service. Factories can still be used for more complex and specific context passing.

  • Individual classes are still responsible of asking the locator what they need. Scalability anyone?

  • Hard dependencies are taken on the SL by every class that uses it.

Previous | Next