Namespace

A namespace is a group of related elements that each have a unique name or identifier. There are several different types of namespaces, and each one has a specific syntax used to define the corresponding elements. Each element within a namespace has a "local name" that serves as a unique identifier.

Namespaces are used in many areas of computing, such as domain names, file paths, and XML documents. Below are examples of these different applications.

  1. Domain Names - The namespace syntax for domain names is specified by the Domain Name System, or DNS. It includes the top-level domain, (e.g. "techterms.com") and a subdomain, such as "www." In the URL "www.techterms.com," the namespace identifier is "techterms.com," while the local name is "www."
  2. File Paths - File locations may be specified using a file path, which can include multiple directories. A file path, which uses syntax defined by the operating system, is considered a namespace. For example, C:\Program Files\Internet Explorer is the namespace that describes where Internet Explorer files on a Windows computer. The namespace /usr/local/apache/ defines the location of Apache files on a Unix-based web server. Individual filenames within these directories serve as unique identifiers.
  3. XML Documents - XML namespaces (XMLNS) are used to associate a document's element and attribute names with a namespace identified by an external URI. For example, an XML file may include HTML elements that are specified at "http://www.w3.org/1999/xhtml." This reference might appear as "<html:html xmlns:html='http://www.w3.org/1999/xhtml'>" near the top of the XML document.

The above examples are just a few types of namespaces used in computing. They are also used to define network devices and other types of computer hardware. Additionally, computer programmers often used namespaces to group related variables within the source code of a program. While there are many different types of namespaces, they all serve the same purpose — to contain a logical grouping of related elements.

Updated April 25, 2013 by Per C.

quizTest Your Knowledge

In which video game is APM most important?

A
Call of Duty
0%
B
Starcraft
0%
C
Skyrim
0%
D
Fortnite
0%
Correct! Incorrect!     View the APM definition.
More Quizzes →

The Tech Terms Computer Dictionary

The definition of Namespace on this page is an original definition written by the TechTerms.com team. If you would like to reference this page or cite this definition, please use the green citation links above.

The goal of TechTerms.com is to explain computer terminology in a way that is easy to understand. We strive for simplicity and accuracy with every definition we publish. If you have feedback about this definition or would like to suggest a new technical term, please contact us.

Sign up for the free TechTerms Newsletter

How often would you like to receive an email?

You can unsubscribe or change your frequency setting at any time using the links available in each email.

Questions? Please contact us.