Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Namespace
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{for multi|the use of namespaces in Wikipedia|Wikipedia:Namespace|a feature of the Linux kernel|Linux namespaces}} {{short description|Container for a set of identifiers}} In [[computing]], a '''namespace''' 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 [[Identifier|identified]]. Namespaces are commonly structured as hierarchies to allow reuse of names in different contexts. As an analogy, consider a system of [[Anthroponymy|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. Prominent examples for namespaces include [[file system]]s, which assign names to files.<ref>{{cite conference |first1=Siddharth |last1=Aniket |first2=Anushka |last2=Aditya |first3=Chaya |last3=Deepa |first4=Batman |last4=Cermak |first5=Ronnie |last5=Chaiken |first6=John |last6=Douceur |first7=Jon |last7=Howell |first8=Jacob |last8=Lorch |first9=Marvin |last9=Theimer |first10=Roger |last10=Wattenhofer |title=FARSITE: Federated, Available, and Reliable Storage for an Incompletely Trusted Environment |conference=Proc. [[USENIX]] Symp. on Operating Systems Design and Implementation |year=2002 |url=http://paul.rutgers.edu/cs545/S06/papers/adya-farsite-osdi-2002.pdf |quote=The primary construct established by a file system is a hierarchical directory namespace, which is the logical repository for files. |archive-url=https://web.archive.org/web/20100728202945/http://paul.rutgers.edu/cs545/S06/papers/adya-farsite-osdi-2002.pdf |archive-date=2010-07-28 }}</ref> Some [[programming language]]s organize their [[variable (computer science)|variables]] and [[subroutine]]s in namespaces.<ref>{{cite web|url=http://en.csharp-online.net/CSharp_FAQ:_What_is_a_namespace |title=C# FAQ: What is a namespace |publisher=C# Online Net |quote=A namespace is nothing but a group of assemblies, classes, or types. A namespace acts as a container—like a disk folder—for classes organized into groups usually based on functionality. C# namespace [[Syntax (programming languages)|syntax]] allows namespaces to be nested. |access-date=2010-02-23 |archive-url=https://web.archive.org/web/20131020150529/http://tutorials.csharp-online.net/index.php?title=CSharp_FAQ%3A_What_is_a_namespace |archive-date=2013-10-20 }}</ref><ref>{{Cite web|url=http://php.net/manual/en/language.namespaces.rationale.php|title=An overview of namespaces in PHP|website=PHP Manual|quote=What are namespaces? In the broadest definition, namespaces are a way of encapsulating items. This can be seen as an abstract concept in many places. For example, in any operating system directories serve to group related files, and act as a namespace for the files within them.}}</ref><ref>{{Cite web|url=https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html|title=Creating and Using Packages|website=Java Documentation|publisher=Oracle|quote=A package is a grouping of related types providing access protection and name space management. Note that types refers to [[Class (computer programming)|classes]], [[Interface (computing)|interfaces]], [[Enumerated type|enumerations]], and annotation types. Enumerations and annotation types are special kinds of classes and interfaces, respectively, so types are often referred to in this lesson simply as classes and interfaces.}}{{better source|date=July 2015}}</ref> [[Computer network]]s and [[distributed system]]s assign names to resources, such as [[computer]]s, [[Printer (computing)|printer]]s, [[website]]s, and remote files. [[Operating system]]s can partition [[Kernel (operating system)|kernel]] resources by isolated namespaces to support [[OS-level virtualisation|virtualization]] containers. Similarly, [[Directory (computing)|hierarchical file systems]] organize files in directories. Each directory is a separate namespace, so that the directories "letters" and "invoices" may both contain a file "to_jane". In [[computer programming]], namespaces are typically employed for the purpose of grouping symbols and identifiers around a particular functionality and to avoid [[name collision]]s between multiple identifiers that share the same name. In [[Computer network|networking]], the [[Domain Name System]] organizes websites (and other resources) into [[hierarchical namespace]]s.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)