E.g. I have
project X
with class a.b.c.d.AbstractFoo
now I have project Y with an implementation of AbstractFoo
Is there a convention on using package names? Is there an advantage, if say, the package names are the same?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The package name of the implementation of
AbstractFooshould make sense for that class, and should not necessarily be the same as the package ofAbstractFoo.I for instance often override / implement
JComponent, still I wouldn’t dream of writingpackage javax.swingin one of my source files.No, not really. There is a semantical difference though, and that is due to the default (package level) access modifier. Relying on that the package name of one project matches the package name of another project seems like a really bad idea to me though.