Using the word java as part of a package name

  • Thread starter Mangalaganesh Balasubramanian
  • Start date
M

Mangalaganesh Balasubramanian

Hi,

Is there any restricion on using java as part of my package name.

For eg,

com.test.java.impl

The JDK do not complain when i compile the code but i wanted to hear
what people do?

I was under the impression that the java as part of the package name
should only be used by the JDK libraries/classes.

Appreciate inputs

Manglu
 
D

Daniel Pitts

Hi,

Is there any restricion on using java as part of my package name.

For eg,

com.test.java.impl

The JDK do not complain when i compile the code but i wanted to hear
what people do?

I was under the impression that the java as part of the package name
should only be used by the JDK libraries/classes.

Appreciate inputs

Manglu

There is no technical restriction, but I wonder why you would want to?
If its a java package, then its clear that its java. The one thing I
would absolutely avoid is having the package name START with "java".
 
L

Lew

Daniel said:
There is no technical restriction, but I wonder why you would want to?
If its a java package, then its clear that its java. The one thing I
would absolutely avoid is having the package name START with "java".

Right. The rule is:
Names of packages intended only for local use should have a first identifier that begins with a lowercase letter, but that first identifier specifically should not be the identifier java; package names that start with the identifier java are reserved by Sun for naming Java platform packages.

Also, I would suspect that use even further down the package hierarchy,
besides being useless, violates Sun's trademark.
 
R

Roedy Green

Is there any restricion on using java as part of my package name.
The restriction is commonsense. Names are meant to make clear the
meaning and use of a package. If you use word "Java" in there you are
engaging in deception, trying to mislead your users this is somehow a
package from Sun or written with Sun's blessing.
 
M

Mike Schilling

Roedy said:
The restriction is commonsense. Names are meant to make clear the
meaning and use of a package. If you use word "Java" in there you are
engaging in deception, trying to mislead your users this is somehow a
package from Sun or written with Sun's blessing.

Not necessarily. I have, for instance, some code that models and generates
statements in various languages. I don't think anyone draws that conclusion
from the com.mycompany.tools.generator.java package (nor does anyone assume
the com.mycompany.tools.generator.csharp package comes from Microsoft.)
 
T

Twisted

Not necessarily. I have, for instance, some code that models and generates
statements in various languages. I don't think anyone draws that conclusion
from the com.mycompany.tools.generator.java package (nor does anyone assume
the com.mycompany.tools.generator.csharp package comes from Microsoft.)

I don't see a problem with using "java" late in a package name,
especially if it's non-redundant as in Mike's example.

Using "java" at the very beginning may be trademark infringement
however, as it may cause confusion as to whether the contents are
officially endorsed by Sun or officially part of the standard library.
Using "com.sun." at the beginning, likewise, or
"com.anyone.else.that.you.are.not.". where registered trademarks are
involved. This because the very beginning part is generally expected
to identify who makes and maintains a package, and misrepresenting
same clearly may infringe trademarks.

-> Stick to a personally-unique or your-organizationally-unique prefix
on your package names and eschew referring to anything trademarked,
unless it's important to distinguish something, in which case stick it
at the very end as in com.mycompany.tools.generator.java.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,128
Latest member
ElwoodPhil
Top