While searching for benefits of JNDI, I came across many [answer](https://stackoverflow.com/questions/4365621/what-is-jndi-what-is-its-basic-use-when-it-is-used)s where it was mentioned that it helps to switch between different environments without changing the application. But why is JNDI used for DNS/LDAP/EJB access? Is it for the same reason or are there additional benefits when it comes to those technolgoies?