How to name the package of my own project?

The usual naming convention is:

[com/org/...].[companyName/organizationName/....].[projectName] 

I used to provide any package name that I like for my own projects. Is there any naming convention for a personal project?

+4
source share
4 answers

You can choose any naming convention that you like for your personal, private projects.

However, I would suggest sticking to standard Java naming conventions as much as you can:

  • This will help to avoid name conflicts if you ever published your code in the future.
  • It’s always good to follow standard practices (at least to maintain good habits!)
+4
source

The agreement is not so much to use the name of the company or other organization, but also to use the domain name . Domains are often called companies, but many developers have their own private domain names that they use to refer to Java packages in personal projects. Therefore, the same convention may apply to all packages, personal or otherwise.

+2
source

No, this is standard. This is due to the fact that any existing domain will always be unique. This ensures that the package name is unique.

Therefore, I would suggest relying on the existing domain for the package, this is good practice.

+1
source

As long as you do not publish your software, any collisions do not bother anyone but yourself. If you have a personal domain name, I recommend that you use it. Otherwise, create something that you think is unlikely to collide.

When you decide to publish your software, it would be nice either to get the domain name for your project, or to us real or fictitious, based on (say) the DNS name of the place that you publish the source code; for example "net.sourceforge.myproject" ... where "myproject" is your official sourceforge project name.

0
source

Source: https://habr.com/ru/post/1440183/


All Articles