Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is reverse DNS notation used for package naming?

There is a technical reason for using the reverse DNS package notation? Or is it just a convention?

like image 348
SimoV8 Avatar asked Aug 10 '15 09:08

SimoV8


People also ask

Why are package names in reverse?

Package names are written in all lower case to avoid conflict with the names of classes or interfaces. Companies use their reversed Internet domain name to begin their package names—for example, com. example. mypackage for a package named mypackage created by a programmer at example.com .

What is Reverse DNS format?

Reverse domain name notation (or reverse-DNS) is a naming convention for components, packages, types or file names used by a programming language, system or framework. Reverse-DNS strings are based on registered domain names, with the order of the components reversed for grouping purposes.

What DNS naming convention?

Domain Naming ConventionsDomains can contain the English-language letters a-z, and the digits 0-9. Hyphens can also be used but it can not be used at the beginning and at the end of a domain name. Two hyphens together is usually not permitted and also hyphens cannot appear at both third and fourth positions.

What is reverse hijacking in cyber law?

Reverse domain name hijacking (also known as reverse cybersquatting or commonly abbreviated as 'RDNH'), occurs where a rightful trademark owner attempts to secure a domain name by making cybersquatting claims against a domain name's "cybersquatter" owner.


1 Answers

I think it's now mostly just a convention but I'd say that it helps to organize things down abit.

Here are afew examples as to why I say so: com.vzy.gui.* and com.vzy.io.*

  • going through them we see, com and think, "oh hey, it's a company that made this"
  • then vzy and think, "the people that made this is vzy!"
  • then gui and io which leads us to see "this one works with GUIs and this other one works with IO, cool."

I think another good way to show this would be to switch it back and see how it would look...

import ArrayList.util.java
import BorderLayout.awt.java
import File.io.java
import JButton.swing.javax
import JFrame.swing.javax
import JLabel.swing.javax
import JOptionPane.swing.javax
import JPanel.swing.javax
import JScrollPane.swing.javax
import JSlider.swing.javax
import LinkedBlockingQueue.concurrent.util.java
import PrintWriter.io.java
import Scanner.util.java
import SwingUtilities.swing.javax

or

import java.awt.BorderLayout
import java.io.File
import java.io.PrintWriter
import java.util.ArrayList
import java.util.Scanner
import java.util.concurrent.LinkedBlockingQueue
import javax.swing.JButton
import javax.swing.JFrame
import javax.swing.JLabel
import javax.swing.JOptionPane
import javax.swing.JPanel
import javax.swing.JScrollPane
import javax.swing.JSlider
import javax.swing.SwingUtilities
like image 111
vzybilly Avatar answered Nov 16 '22 00:11

vzybilly