Is JNDI bad as service locator design pattern?
<p>I'm a Java EE nooby developer, According to many resources on the internet which claim that service locator design pattern is an anti-pattern because it hides classes dependecies and more things and should be avoided as many as possbile and using Dependecy Injection instead, as we know JNDI is an implemantation of service locator pattern.</p>

<p>I googled to check that JNDI is an implementation of service locator and i found this response which claims this : <a href="https://stackoverflow.com/questions/5143499/understanding-jndi">Understanding JNDI</a></p>

<p>Althought i see that JNDI is used in Java EE application for many purposes (Datasources, EJB lookup ...), So should i use it or should i avoid it as more as possible?, if JNDI isn't bad then service locator isn't?</p>