Re: namespace hierarchy best practices



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?

.



Relevant Pages

  • Re: modules and generated code
    ... CORBA stubs/skels) in a particular package is there a way of placing my ... own code under the same package hierarchy without all the code living in ... the same directory structure. ... Maybe I'm missing something obvious, but it sounds like you are over-complicating the idea of inheritance. ...
    (comp.lang.python)
  • Re: modules and generated code
    ... CORBA stubs/skels) in a particular package is there a way of placing my ... own code under the same package hierarchy without all the code living in ... the same directory structure. ...
    (comp.lang.python)
  • Re: unexpected error with Exporter
    ... This is the problem - the package hierarchy should always ... the 'import' method of Exporter will ... A-1010 Vienna / AUSTRIA ...
    (comp.lang.perl.misc)
  • Re: K-Means Algorithm
    ... > present on common lisp implementations without installing some other package ... so it seems a bit of an overkill in order do just ...
    (comp.lang.lisp)
  • [SLE] Smart not working
    ... I tried to get smart working. ... seems like overkill to me. ... But whenever I try to update a package, I get a list of Python errors. ... Google gives me no joy in tracking this down. ...
    (SuSE)