How should I name a Java package?
A common naming scheme used is the following (|
means or):
country
| org
|com
.name
.applicationName
.subpackages
Name
is either a company or your name. And after the applicationName
you start all your subpackages (that is what I mean in the end) e.g. util
, ui
,db
etc
For example if you are John Dave from England use en.jdave.smartapp.ui.core.forms
. Or Marcus German From Germany: de.mgerman.smartapp.ui.core.forms
etc
Macro206
Updated on June 30, 2022Comments
-
Macro206 almost 2 years
Possible Duplicate:
What package naming convention do you use for personal/hobby projects in Java?I am learning Java and have found a problem. I would need a domain name for my packages, but I don't have one. I wouldn't like to use my email address. So should I make an account on SourceForge or GitHub and use that? If so, which one is best? Or is there another, better method? Thanks
-
Jeffrey almost 12 yearsIf you use that idiom, it implies that you own that domain. The OP does not own a domain.
-
Macro206 almost 12 yearsCould I use a GitHub domain as my domain?
-
Cratylus almost 12 yearsThe idea is that this is a common structure to create a package name.Use for name your company name or your personal name.For example if you are John Dave from England:
en.jdave.smartapp.ui.core.forms
. From Germany:de.jdave.smartapp.ui.core.forms
etc Also it doesn't have to be something universally unique unless you expect to be used by major companies across the world -
cubuspl42 almost 6 years"I am learning Java and have found a problem. I would need a domain name for my packages, but I don't have one"