Naming Collision
   HOME

TheInfoList



OR:

A naming collision is a circumstance where two or more
identifiers An identifier is a name that identifies (that is, labels the identity of) either a unique object or a unique ''class'' of objects, where the "object" or class may be an idea, physical countable object (or class thereof), or physical noncountable ...
in a given
namespace 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 identified. Namespaces ...
or a given
scope Scope or scopes may refer to: People with the surname * Jamie Scope (born 1986), English footballer * John T. Scopes (1900–1970), central figure in the Scopes Trial regarding the teaching of evolution Arts, media, and entertainment * Cinem ...
cannot be unambiguously resolved, and such unambiguous resolution is a requirement of the underlying system.


Example: XML element names

In
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. T ...
, element names can be originated and changed to reflect the type of information contained in the document. This level of flexibility may cause problems if separate documents encode different kinds of information, but use the same identifiers for the element names. For example, the following sample document defines the basic semantics for a "person" document and a "book" document. Both of these use a "title" element, but the meaning is not the same: Nancy Davolio Dr. 29 Harry Potter And The Cursed Child ABCD1234567 For an application to allow a user to correctly query for and retrieve the "title" element, it must provide a way to unambiguously specify ''which'' title element is being requested. Failure to do so would give rise to a naming collision on the title element (as well as any other elements that shared this unintended similarity). In the preceding example, there is enough information in the structure of the document itself (which is specified by the "root" element) to provide a means of unambiguously resolving element names. For example, using
XPath XPath (XML Path Language) is an expression language designed to support the query or transformation of XML documents. It was defined by the World Wide Web Consortium (W3C) and can be used to compute values (e.g., strings, numbers, or Boolean v ...
: //root/person/title ;; the formal title for a person //root/book/title ;; the title of a book


Collision domain

{{Original research, date=September 2007 The term ''
collision domain In physics, a collision is any event in which two or more bodies exert forces on each other in a relatively short time. Although the most common use of the word ''collision'' refers to incidents in which two or more objects collide with great f ...
'' may also be used to refer to a system in which a single name or identifier is open to multiple interpretations by different layers or processing. The notion of a
namespace 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 identified. Namespaces ...
has been widely adopted as a
software programming Computer programming is the process of performing a particular computation (or more generally, accomplishing a specific computing result), usually by designing and building an executable computer program. Programming involves tasks such as anal ...
practice to avert undesired clashes. Note that its use in the networking field is superficially similar, but quite different in reality.


See also

*
Name collision In computer programming, a name collision is the nomenclature problem that occurs when the same variable name is used for different things in two separate areas that are joined, merged, or otherwise go from occupying separate namespaces to sharin ...
*
Namespace 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 identified. Namespaces ...
*
XML Namespaces XML namespaces are used for providing uniquely named elements and attributes in an XML document. They are defined in a W3C recommendation. An XML instance may contain element or attribute names from more than one XML vocabulary. If each vocabulary ...
*
Delimiter collision A delimiter is a sequence of one or more characters for specifying the boundary between separate, independent regions in plain text, mathematical expressions or other data streams. An example of a delimiter is the comma character, which acts a ...


References

Programming constructs