In math and computer science, general concepts are those that can be used in many situations. Being familiar with these concepts in a more formal manner helps us recognize them in the wild and incorporate them into designs or coding.
We are all familiar with namespaces, but maybe not under that name, and not in a systematic manner. For instance, telephone numbers comprise a namespace. Lets think about some attributes of this namespace. We know that a telephone number must uniquely identify a single phone. We know there is some degree of hierarchy to telephone numbers. At the highest level we have a country code, and below that the area code. Decades ago, the area code designated a specific geographic area, when phones were wired into fixed locations, but with the advent of cell phones, the area code no longer has geographic significance, and simply adds three digits to the original 7 digit phone number.
This one simple example provides an essential requirement for many namespaces—the ability to uniquely identify something.
Mailing addresses comprise another familiar namespace. Given the way that mailing addresses evolved over the past 300 years, the mailing address is tightly coupled to geographic location. The mailing address has more of a hierarchical structure. For mail within America, we have the 50 states and District of Columbia (which is some sort of federal island and not considered a state).
Within states, we have cities, and within cities, we have streets and ultimately the house or building number. The mailing address namespace introduces two new concepts—the partitioning of a space, and the hierarchy. The partitioning and hierarchical structure allow us to conveniently designate a single address among hundreds of millions. It would be possible to assign something like a 10 character code to a house or building. This would be very convenient for a computer, but not for people.
More formally, a partition is a set operation whereby a set of some sort is divided into subsets. Partitioning the continental United States into states is a familiar example. In this case, the set is the land area The formal definition of a partitioned space has two interesting set based properties—the union of all partitions yields the original set. The intersection of the partitions yields a null set, or nothing. In other words, when a space is partitioned, there are no overlaps among partitions.
As a state is partitioned to city names, we see that the partitioning of a space can yield a hierarchy. The hierarchical namespace is ubiquitous, and for those of us who have used computers a bit, the nested folder structure of files on a disk drive comes to mind.
When visualizing a hierarchical namespace, the inverted tree structure is often used. At the top is the root of the namespace and the lower nodes represent partitions of the higher nodes. So, an inverted tree diagram of mailing addresses in the US would have the US as the root node, and below that, a node for each state, with city nodes partitioning the state node.
So, when thinking about namespaces in a slightly more formal manner, we have some attributes of a namespace we can think about. For example:
1) Does a namespace need to uniquely identify something?
2) Is there a hierarchical/partitioned structure to the namespace?
3) What might be the root of a namespace?
4) How many levels deep is a namespace?
5) How many unique elements can a namespace identify?
In sum, partitioning sets of things into namespaces is ubiquitous both in computer work and daily life. I hope this discussion helps you think about about namespaces while navigating the real world as well as computer activities.