Naming collision

Naming collision

A naming collision is a circumstance where two or more identifiers in a given namespace or a given scope cannot be unambiguously resolved, and such unambiguous resolution is a requirement of the underlying system.

Contents

Example: XML element names

In XML, 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:

<root>
    <person>
        <fname>Nancy</fname>
        <lname>Davolio</lname>
        <title>Dr.</title>
        <age>29</age>
    </person>
 
    <book>
        <title>Ms.</title>
        <isbn>ABCD1234567</isbn>
    </book>
</root>

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:

   //root/person/title          ;; the formal title for a person
   //root/book/title            ;; the title of a book

Collision domain

The term collision domain 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 has been widely adopted as a software programming practice to avert undesired clashes.

See also

References



Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Nibiru collision — This article is about the doomsday scenario. For other uses, see Nibiru. V838 Mon, a star with an expanding light echo, purported as photographic evidence of Nibiru The Nibiru collision is a supposed disastrous encounter between the Earth and a… …   Wikipedia

  • Delimiter — This article is about delimiters in computing. For delimiters in written human languages, see interword separation. A stylistic depiction of a fragment from a CSV formatted text file. The commas (shown in red) are used as field delimiters. A… …   Wikipedia

  • XML — Infobox file format name = Extensible Markup Language icon = logo = extension = .xml mime = application/xml, text/xml (deprecated) type code = uniform type = public.xml magic = owner = World Wide Web Consortium genre = Markup language container… …   Wikipedia

  • Namespace (computer science) — For namespaces in general, see Namespace. A namespace (sometimes also called a name scope) is an abstract container or environment created to hold a logical grouping of unique identifiers or symbols (i.e., names). An identifier defined in a… …   Wikipedia

  • Self-documenting — In computer programming, self documenting (or self describing) is a common descriptor for source code that follows certain loosely defined conventions for naming and structure. These conventions are intended to enable developers, users and… …   Wikipedia

  • Name resolution — Contents 1 In computer languages 1.1 Static versus dynamic 1.2 Name masking 1.3 Alpha renaming to make name resolution trivial …   Wikipedia

  • Controversy over the discovery of Haumea — Main article: Haumea (dwarf planet) Keck image of Haumea and its two moons Haumea was the first of all the current …   Wikipedia

  • Abkürzungen/Computer — Dies ist eine Liste technischer Abkürzungen, die im IT Bereich verwendet werden. A [nach oben] AA Antialiasing AAA authentication, authorization and accounting, siehe Triple A System AAC Advanced Audio Coding AACS …   Deutsch Wikipedia

  • Liste der Abkürzungen (Computer) — Dies ist eine Liste technischer Abkürzungen, die im IT Bereich verwendet werden. A [nach oben] AA Antialiasing AAA authentication, authorization and accounting, siehe Triple A System AAC Advanced Audio Coding AACS …   Deutsch Wikipedia

  • Comet — This article is about the astronomical object. For other uses, see Comet (disambiguation). Comet Hale– …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”