Okay, so I'm wanting tips on how to pick a name for my Java packages.
I saw this post: What package naming convention do you use for personal/hobby projects in Java? but this talks about personal projects.
What if for example I wanted to make an API Wrapper, and I develop with others on GitHub? I don't have a domain name.
The domain-name-backwards convention is there to prevent name collisions. Two different companies with the same product name will have different namespaces so everything works fine.
If you don't have a domain then you need to choose a name that is meaningful to you and will not collide with anything else. That's OK; it just means very slightly more work for you to make sure that there isn't an existing product with the name you want, and there may be difficulties if there ever is a name collision.
You won't be the first to do this: the JMockit library is all in the "mockit" namespace with no "com" or "org" prefix.
The recommendation has always been to start with your domain name backwards, then the project name, e.g. com.mycompany.myproject, and continue on with submodules as necessary.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With