Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

May I use com.google.code prefix for my packages?

Tags:

java

I have a hobby opne source Java project hosted at google code (linkset).

May I use a prefix "com.google.code.linkset" as a package name for this project?

P.S. I dont own "org.linkset" domain :( but i like the name :)

like image 343
Łukasz Bownik Avatar asked Apr 14 '10 08:04

Łukasz Bownik


People also ask

Why do package names start with com?

Generally we android developer having practice to decide package name based on the domain name of a particular company. For example: Domain name: sun.com => Root package name something like : com. sun.

What is package prefix?

A source folder with a package prefix is displayed in the Project View like so: If src has a package prefix org. example. application , IntelliJ IDEA treats that directory as src/org/example/application . (So, the package prefix is actually a directory prefix but is expressed in terms of the .

What does COM mean in package names?

com => domain. something => company name. something => Main package name.

What should I name my Java package?

Naming Conventions 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 .


2 Answers

the name of your packages does not have to reflect the domain it's hosted at.

I think using com.google prefix will mislead your users into thinking the code was developed at google. don't do it unless you want to handle the backfire from your users when they realize it's not.

like image 107
Omry Yadan Avatar answered Sep 30 '22 22:09

Omry Yadan


Since it would be misleading as Omry already mentioned, why not use org.lbownik.util.linkset?

like image 37
stacker Avatar answered Sep 30 '22 20:09

stacker