namespace
Sign in to saveAlso known as ns
In computing, a names space is a set of signs (names) that are used to identify and refer to objects of various kinds. A namespace ensures that all of a given set of objects have unique names so that they can be easily identified.
Wikidata facts
Show 2 more facts
- Stack Exchange tag
- stackoverflow.com/tags/namespaces
- P13411
- Wikimedia Commons
Sources (2)
via Wikidata · CC0
~31 min read
Article
21 sectionsContents
- Name conflicts
- Solution via prefix
- Naming system
- Examples
- Delegation
- Hierarchy{{anchor|hierarchical namespace}}
- Namespace versus scope
- Computer-science considerations
- Use in common languages
- C
- C++
- C#
- Java
- PHP <!-- This section is linked from [[PHP]] -->
- Python
- Rust
- XML namespace <!-- This section is linked from [[XML]] -->
- SAP Namespace
- Emulating namespaces
- See also
- References
In computing, a names space is a set of signs (names) that are used to identify and refer to objects of various kinds. A namespace ensures that all of a given set of objects have unique names so that they can be easily identified.
Namespaces are commonly structured as hierarchies to allow reuse of names in different contexts. As an analogy, consider a system of naming of people where each person has a given name, as well as a family name shared with their relatives. If the first names of family members are unique only within each family, then each person can be uniquely identified by the combination of first name and family name; there is only one Jane Doe, though there may be many Janes. Within the namespace of the Doe family, just "Jane" suffices to unambiguously designate this person, while within the "global" namespace of all people, the full name must be used.