Traditionally, directories have been used to store data. Users and programmers think of the directory as a hierarchy of directory entries, each containing a set of attributes. You look up an entry from the directory and extract the attribute(s) of interest. For example, you can look up a person's telephone number in the directory. Alternatively, you can search the directory for entries that have a particular set of attributes, for example all persons in the directory with the surname Smith. Examples of this type of use of the directory are covered in The Basics trail.
For applications written in the JavaTM programming language, Java objects are typically shared. For such applications, it makes sense to be able to use the directory as a repository for Java objects. The directory provides a centrally administered, and possibly replicated, service for use by Java applications distributed across the network. For example, an application server might use the directory for registering objects that represent the services that it manages so that a client can later search the directory to locate those services as needed.
The JNDI provides an object-oriented view of the directory, thereby allowing Java objects to be added to and retrieved from the directory without requiring the client to manage data representation issues. This trail discusses the use of the directory for storing and retrieving Java objects.
The Storing Objects in the Directory lesson describes how serializable objects, referenceable objects, remote objects, and objects with attributes can be stored in the directory.
The State Factories lesson describes the role of state factories and their use by applications and service providers.
The Reading Objects from the Directory lesson describes the different ways that objects can be read from the directory.
The Object Factories lesson describes the role of object factories and their use by applications and service providers.
The Representation in the Directory lesson describes the format in which objects are stored in directories, such as LDAP directories.