Naming Service in a Nutshell

In the past few months, I have been working on a Java EE project. There are many critical terms/concepts/technologies in Java EE World. JNDI is one of them. JNDI plays an extremely important role in Java EE. There is no doubt that if you didn't understand JNDI, you would find you are stuck in the trouble.

Naming Service, is the basic concept to JNDI.

In order to make you clear about what Naming Service is, I would compare it to a card catalog in an olden library. Imagine that you want to find a book there, you would not try to find it floor by floor, one by one. Instead, you would try to check the card catalog to locate the book, after you locate the book, you can go to get it.

As surprising as it may seem, the notion of a card catalog is quite handy in the world of computing, as well. In computing, we call it a naming service which associates names with the locations of services and with information. It provides computer programs with a single location where they can find the resources they need. In the way, programs don't waste time by performing the electronic equivalent of walking up and down the aisles, and don't require that locations be hardcoded into their logic, either.

Finding resources is of particular importance in large-scale enterprise environments, where the applications you build may depend on services provided by applications written by other groups in other departments. A well-designed naming infrastructure makes such projects possible -- and the lack of one makes them impossible. In fact, many business-process reengineering efforts begin with the design and implementation of a robust, enterprise-wide naming and directory infrastructure.

The figure below depicts the organization of a generic naming service.

A naming service maintains a set of bindings. Bindings relate names to objects. All objects in a naming system are named in the same way(that is, they subscribe to the same naming convention). Clients use the naming service to locate objects by name.


comments powered by Disqus