24 Mayıs 2010 Pazartesi

Service Locator vs Dependency Injection

Service Locator ile Dependency Injection arasindaki temel fark:
Service Locator' u kullanan user' larin her biri Service Locator' dan kendilerine bir servis sorgulamak zorundadir. Dependency Injection' da ise boyle bir sorgulama yok.

The key difference between the two patterns is about how that implementation is provided to the application class. With service locator the application class asks for it explicitly by a message to the locator. With injection there is no explicit request, the service appears in the application class - hence the inversion of control.

Hiç yorum yok: