Why use the structure com.company.project?

Does anyone know the practical reasons for the structure of the com.company.project package and why it has become the de facto standard?

Does anyone really store everything in a folder structure that directly reflects this package structure? (this happens in terms of Actioncript, by the way)

+5
source share
4 answers

Name conflict prevention is a pretty practical reason for such package structures. If you use the real domain names that you own, and everyone else uses their package names for the same role, collisions are extremely unlikely.

Esp. Java " ". , , , , ; -)

: Java world ( .jar), : , .

, , - .

+5

. TLD, , , , .

, Utility Logging , , , Foo.Logging Bar.Logging, :)

+2

, , -, , .

.

+1

:

  • ,

. YYYY/MM/DD, DD/MM/YYYY: , , , , , . ( ), , .

subsub.sub.domain.suffix, .. . suffix.domain.sub.subsub.

, Java Language Specification 3rd Edition, :

7.7

, , . . . Java , .

, . . ClassLoader , , , .

, ( , ) , sun.com. , , com.sun , , , .

The name of the package does not mean that the package is stored on the Internet; for example, a package with a name is edu.cmu.cs.bovik.cheesenot necessarily available from an Internet address cmu.eduor from cs.cmu.eduor from bovik.cs.cmu.edu. The proposed convention for creating unique package names is just a way to negotiate a package naming convention on top of the existing well-known unique name registry, rather than creating a separate registry for package names.

+1
source

All Articles