xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: Proposed guidelines for package distribution of Java projects
Date Sun, 21 Nov 1999 23:42:59 GMT
David_Marston/CAM/Lotus@lotus.com wrote:
> I have extensive experience with the versioning issues raised by Stefano. I
> support the idea
> of a Version class.
> At this point, I only want to suggest that we be more explicit about the uses of
> the version labels.
> >1) Versioning
> >
> >I propose that every package named
> > org.apache.xxx
> >contains a class named Version like this
> >
> >public class Version {
> >...
> >   public static String getVersion() {
> >    return "1.6"
> >   }...
> >}
> We should be explicit about whether we intend this version label to
> be usable in strict numeric comparisons, meaning that there is just
> one decimal point. If more than two "decimal" fields are allowed, then
> you can still test whether the version is earlier than a minimum, but
> it's not as easy as a simple numeric < test. However, multiple fields
> are nice for isolating different degrees of change in the different
> release levels.

Instead of hardcoding the versioning type, in the Avalon project we came
up with something like

  boolean isCompatible(Version version);

which returns false if the given version is compatible with the called
one, compatible means that it can be replaced with no behavioral
difference. It's up to the Version implementor to come up with the logic
to evaluate this (a simple yet valid implementation would always return
false, while normal implementations will return true if in an x.y.z
version x and y are equal)

> 3) package name
> >I propose the following name model for packages
> > name[-type]-version.jar...
> >note that "name" and "version" _must_ be the one passed by "getName()"
> >and "getVersion()" methods in Version.
> This raises some interesting possibilities in the build/make area.
> Can we put the name and version labels in exactly one place in the
> source, then generate the package name from them?

What about

public class Version {

  public static void main(String args[]) {
     system.out.println(getName() + "-" + getVersion());

so you can call

   java org.apache.<project>.Version

and you have


than you can add "type" if required and get


(which changes the original proposal a little) how's that?
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche

View raw message