Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Disadvantages PoV  
4 comments  













Talk:Service locator pattern




Page contents not supported in other languages.  









Article
Talk
 

















Read
Edit
Add topic
View history
 








Tools
   


Actions  



Read
Edit
Add topic
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


Disadvantages PoV[edit]

The section on disadvantages currently says that:

The registry makes the code more difficult to maintain (opposed to using Dependency injection), because it becomes unclear when you would be introducing a breaking change

"more difficult" here is totally subjective. You can't count the difficulty here, or at least you have to define what is meant by "difficult" and then show how the amount is different when using two strategies. My experience with both technologies is that neither has any benefits when it comes to noticing breaking changes. (PoV again). Of course, DI needs to be mentioned in the context of Service Locator, because it is the perfect opposite of it, but not as a superior, rather as an equivalent mechanism. There are projects which try to promote the idea of DI superiority, but I'm afraid it has to do with marketology, or maybe a kind of blind conviction. 109.64.122.102 (talk) 09:57, 18 January 2014 (UTC)[reply]

Actually, here, to back up my point, the quote from Dependency Injection article:

The dependency injection container makes the code more difficult to maintain, because it becomes unclear when you would be introducing a breaking change.

From reading this, I'd say that both techniques obscure dependencies by introducing a level of indirection. None is better in this regard. 109.64.122.102 (talk) 10:19, 18 January 2014 (UTC)[reply]

--- I agree that there is no superiority, also the two technologies can be combined defining a priority, usually first injection and then, if no injection present, default to service locator. This is also the common way of refactoring legacy code. I want to add on the differences between the two: with DI, when one configures it, he needs to know the implementation name, while with service locator configuration might not be needed and the client be unaware of this aspect. At the same time one implementation, configured for a service locator, might not be actually used since in some environments could not even be possible to load it and an other implementation is served, this is not normally possible with DI. 2.234.41.128 (talk) 18:53, 26 August 2014 (UTC)[reply]

The main criticism of service location is that it is an anti-pattern

Tautology? — Preceding unsigned comment added by Bartpio (talkcontribs) 04:34, 21 June 2018 (UTC)[reply]


Retrieved from "https://en.wikipedia.org/w/index.php?title=Talk:Service_locator_pattern&oldid=1201555809"

Categories: 
Stub-Class Computing articles
Low-importance Computing articles
All Computing articles
 



This page was last edited on 31 January 2024, at 22:27 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki