Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should I name packages if I don't have a domain associated with me? [closed]

So most Java resources when speaking of packages mention a com.yourcompany.project setup. However, I do not work for a company, and don't have a website. Are there any naming conventions that are common? An email address, perhaps?

like image 846
Bernard Avatar asked Oct 03 '08 09:10

Bernard


2 Answers

Use a top-level domain like 'bernard' or something else unique. The important part is that the domain is unique so that you avoid clashes, and not that it starts with a real Internet top-level domain like org or com. E.g.

import java.util.*; import bernard.myProject.*; import org.apache.commons.lang.*; 
like image 68
Stu Thompson Avatar answered Sep 28 '22 05:09

Stu Thompson


If your creating an open source project, you could register it with Sourceforge and use net.sourceforge.myproject. This is common with a lot of Java projects. An example is PMD http://pmd.sourceforge.net/.

like image 43
brianegge Avatar answered Sep 28 '22 06:09

brianegge