Re: namespace hierarchy best practices
- From: "jdeveloper" <fawad.malik@xxxxxxxxx>
- Date: 17 Jul 2006 12:29:04 -0700
Wow, great feedback from both of you.
Mark: Not overkill at all, but a very relevant direction.
I'd interested in more feedback on this. Merely googling about codehaus
and sourceforge projects has given me lots of meaningful info.
Thank you Ed and Mark
Mark Space wrote:
Ed wrote:
jdeveloper skrev:
Are there best practices guidelines for package or namespace
hierarchies? (other than :don't make too many of them)
Starting with a developer setup.
If I wanna start under my project directory: c:\jwork
what would be the best practices for creating and placing source code
package hierarchies?
There is, firstly, a common practice of reversing your web-address and
using it as the root of your package hierarchy. So if you thinking of
developing a banking system, and your home page is www.jdeveloper.com,
then your package hierarchy will begin (for example):
com.jdeveloper.bank
Besides this, I've also seen package use the name of their project or
product as the root of a package. For example, if you make a product
for Java developers name SuperLibrary, the your package is named
superlibrary, and everything is under there
import superlibrary.supercomponent;
import superlibrary.utils.superutility;
//etc...
Just make sure no one is using the same name, and you'll probably be ok.
As an aside, I've often wondered if there should a convention for people
who don't have their own domain names to release under. Let's say you
have a project at Source Forge. You could release your package under:
import net.sourceforge.projects.myproject.*;
This would require cooperation from the domain name owner. They should
specify where collaborations or codehaus projects get released under
their hierarchy, and how an individual project name is determined and
made unique. Most codehaus projects already have a way of making the
project name unique, so they'd just have to specify where the project is
released.
Any interest you think? Or overkill?
.
- References:
- namespace hierarchy best practices
- From: jdeveloper
- Re: namespace hierarchy best practices
- From: Ed
- Re: namespace hierarchy best practices
- From: Mark Space
- namespace hierarchy best practices
- Prev by Date: Re: Groovy experience ?
- Next by Date: Re: Smarter than BigDecimal Class
- Previous by thread: Re: namespace hierarchy best practices
- Next by thread: JNI problems, dll generation with Visual studio 8, repost
- Index(es):
Relevant Pages
|