Package Naming

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff Yoshimi

    #1

    Package Naming

    Hi,

    I am currently redesigning some code of mine and trying to determine
    the best way to "package" it. So far I've been doing this more or
    less blindly, so I thought I'd consult this group.

    Actually, I've never heard the motives or history of java
    package-naming conventions (with the orgs, edus, coms, etc). Is the
    idea to provide a space of classes that are as organized as possible?
    What is the relation between this structure and say, the internet,
    where url's end with .com, .edu, etc? Knowing the relevant history
    and motives might help me use the conventions appropriately. Pointers
    to sites discussing this, or info of any kind, appreciated.

    Ok, on to specifics. I have a java-based neural net
    (simbrain.sourc eforge.net) that I'm currently re-writing. In
    particular, I've separated the network model from the rest of the
    simulation "view." In the future, two other components (gauges and a
    simulated environment) will also be abstracted. Currently (but not on
    the site) I have two jars:

    simbrain.jar (network GUI, world, gauges, etc)
    simnet.jar (neural network model. No graphics, no dependency on
    simbrain.jar)

    I was planning to build these from two directories:

    /org/simbrain/sim/....
    /org/simbrain/simnet/....

    But I could also use:

    /org/simbrain/networkGUI
    /org/simbrain/gauge
    /org/simbrain/world
    /org/simbrain/simulation

    and

    /org/simbrain/networkModel

    respectively.

    Any thoughts on my packaging scheme (pitfalls you see looming,
    suggestions, better names than "networkGUI " and "networkMod el", etc)
    would be appreciated. Thanks,

    Jeff
  • Ingo Pakleppa

    #2
    Re: Package Naming

    On Sun, 29 Jun 2003 14:26:16 -0700, Jeff Yoshimi wrote:
    [color=blue]
    > Hi,
    >
    > I am currently redesigning some code of mine and trying to determine the
    > best way to "package" it. So far I've been doing this more or less
    > blindly, so I thought I'd consult this group.
    >
    > Actually, I've never heard the motives or history of java package-naming
    > conventions (with the orgs, edus, coms, etc). Is the idea to provide a
    > space of classes that are as organized as possible?[/color]

    The idea is to make sure that libraries from different companies don't
    conflict. With this scheme, you can be sure that a company ABC software
    (who has domain abc.com) won't create a package abc that might clash with
    one from ABC development (who might have domain abc.net).
    [color=blue]
    > What is the relation between this structure and say, the internet, where
    > url's end with .com, .edu, etc? Knowing the relevant history and
    > motives might help me use the conventions appropriately. Pointers to
    > sites discussing this, or info of any kind, appreciated.[/color]

    There is no relationship. It simply was a convenient way of guaranteeing
    unique names.
    [color=blue]
    > Ok, on to specifics. I have a java-based neural net
    > (simbrain.sourc eforge.net) that I'm currently re-writing. In
    > particular, I've separated the network model from the rest of the
    > simulation "view." In the future, two other components (gauges and a
    > simulated environment) will also be abstracted. Currently (but not on
    > the site) I have two jars:
    >
    > simbrain.jar (network GUI, world, gauges, etc) simnet.jar (neural
    > network model. No graphics, no dependency on simbrain.jar)
    >
    > I was planning to build these from two directories:
    >
    > /org/simbrain/sim/....
    > /org/simbrain/simnet/....
    >
    > But I could also use:
    >
    > /org/simbrain/networkGUI
    > /org/simbrain/gauge
    > /org/simbrain/world
    > /org/simbrain/simulation
    >
    > and
    >
    > /org/simbrain/networkModel
    >
    > respectively.
    >
    > Any thoughts on my packaging scheme (pitfalls you see looming,
    > suggestions, better names than "networkGUI " and "networkMod el", etc)
    > would be appreciated. Thanks,[/color]

    Beyond the org.simbrain, there really are no general rules. Larger
    companies use division names or the like after the domain name to avoid
    in-house clashes. Other than that, you can choose whatever you like.
    Packages do not distinguish between sub-packages, or packages in a
    completely different hierarchy. The only technical difference is whether
    the package is "identical" .

    --
    Keep American Families united! Support H.R. 539 and H.R. 832
    For more information, see http://www.kkeane.com/lobbyspousal-faq.shtml

    Comment

    Working...