Comp Sci: namespace vs directory

Self-tutoring about comp sci: the tutor mentions namespaces and directories.

A namespace, from a very broad point of view, is a top-level category under which other entities can be placed. Let’s imagine you have two namespaces, called magnet and cat, and that each contains the element gray.

Now, magnet.gray and cat.gray can be absolutely different, and totally unrelated. The reason is that they’re from different namespaces. Families work the same: John Smith is expected to be a different person from John Jones. A family last name is a namespace.

A computer directory can be thought of as a kind of namespace. Yet, directories often use slashes, while namespaces use dots. Since both might be used simultaneously, the naming convention might need careful attention. Sometimes, for instance, a file might be located at “dir0/f0”, but the API might refer to it as “dir0.f0”, in which case calling it “dir0/f0” might lead to a “not found” error.

Source:

wikipedia

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Leave a Reply