Re: namespace hierarchy best practices
- From: Mark Space <markspace@xxxxxxxxxxxxx>
- Date: Mon, 17 Jul 2006 15:53:56 GMT
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?
.
- Follow-Ups:
- Re: namespace hierarchy best practices
- From: jdeveloper
- Re: namespace hierarchy best practices
- References:
- namespace hierarchy best practices
- From: jdeveloper
- Re: namespace hierarchy best practices
- From: Ed
- namespace hierarchy best practices
- Prev by Date: Re: Byte Array
- Next by Date: Re: Fetching Contacts using JavaMail?
- Previous by thread: Re: namespace hierarchy best practices
- Next by thread: Re: namespace hierarchy best practices
- Index(es):
Relevant Pages
|