请输入您要查询的百科知识:

 

词条 Reverse domain name notation
释义

  1. History

  2. Examples

  3. Regular expression

  4. Code

     C#  Java 8 and later  JavaScript  Julia  Go  PHP  Python  Ruby  Rust  Swift  Zsh  Kotlin 

  5. References

  6. External links

{{About|the Java-like naming convention|network process|Reverse DNS lookup}}{{One source|date=May 2011}}

Reverse domain name notation (or reverse-DNS) is a naming convention for the components, packages, and types used by a programming language, system or framework. A characteristic of reverse-DNS strings is that they are based on registered domain names, and are only reversed for sorting purposes. For example, if a company making a product called "MyProduct" has the registered domain name "example.com", they could use the reverse-DNS string "com.example.MyProduct" to describe it. Reverse-DNS names are a simple way of reducing name-space collisions, since any domain name is registered by only one party at a time.

History

Most of the world follows the Internet standard and writes email addresses starting with the name of the computer and ending up with the name of the country. In the U.K. the Joint Academic Networking Team (JANET) had decided to do it the other way round before the Internet domain standard was established. Most gateway sites have ad-hockery in their mailers to handle this, but can still be confused. In particular, the address me@uk.ac.bris.pys.as could be interpreted in JANET's big-endian way as one in the U.K. (domain uk) or in the standard little-endian way as one in the domain as (American Samoa) on the opposite side of the world.[1]

Reverse-DNS first became widely used with the Java platform, and has since been used for other systems, for example, ActionScript 3 packages and Android applications.{{Citation needed|reason=need a source for the chronology and why they're particularly historic|date=January 2013}}

Examples

Examples of systems that use reverse-DNS are Sun Microsystems' Java platform and Apple's Uniform Type Identifier or UTI. The Android operating system also makes use of the notation for classifying applications, as the Dalvik virtual machine made use of Java.

dconf which is the configuration back end used by GNOME.

Example of reverse-DNS strings are:

  • com.adobe.postscript-font (UTI string for Adobe Systems's PostScript fonts)
  • com.apple.ostype (UTI string for Apple's OSType)
  • org.omg.CORBA (Java library for CORBA)
  • org.w3c.dom (Java library for W3C's DOM)

Regular expression

{{Tone|section|date=June 2018}}^[A-Za-x]{2,6}((?!-)/.[A-Za-z0-9-]{1,63}(?

Code

{{Tone|section|date=July 2018}}

C#

static string ReverseDomainName(string domain)

{

}

Java 8 and later

static String Domain(final String domain) {

final List components = Arrays.asList(domain.split("///"));

Collections.reverse(components);

}

JavaScript

function reverseDomain(domain) {

}

Julia

reversedomain(d) = join(split(d, ".") |> reverse, ".")

Go

func reverseDomain(domain string) string {

s := strings.Split(domain, ".")

sort.Sort(sort.Reverse(sort.StringSlice(s)))

return strings.Join(s, ".")

}

PHP

function reverseDomain($domain) {

}

Python

def reverse_domain(domain):

Ruby

def reverse_domain(domain)

end

Rust

fn reverse_domain(domain: &str) -> String {

}

Swift

func reversed(domain: String) -> String {

    return domain        .split(separator: "/")        .reversed()        .joined(separator: "/")

}

Zsh

function reverse_domain() {

}

Kotlin

fun reverseDomain(domain: String) = domain.split("/").reversed().joinToString("/")

References

1. ^Jargon File: Big-endian
  • {{cite web |url=https://developer.apple.com/library/mac/#documentation/FileManagement/Conceptual/understanding_utis/understand_utis_intro/understand_utis_intro.html |title=Apple Developer Connection: Introduction to Uniform Type Identifiers Overview|date=2005-11-09 |accessdate=2013-04-04}}

External links

  • Eclipse Naming Conventions
  • [https://gcc.gnu.org/ml/java/2000-04/msg00095.html Re: gnu. namespace discussion]

1 : Domain name system

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/13 16:34:23