[jdom-interest] Re: TODO.TXT: jdom.jar main method and class

steven.gould at cgiusa.com steven.gould at cgiusa.com
Fri Feb 23 11:47:13 PST 2001


Jason Hunter wrote:

> steven.gould at cgiusa.com wrote:
> >
> > Joseph Bowbeer wrote:
> >
> > > I'm familiar with executable .jar files, but JDOM is not a server, and I
> > > don't know of any pure libraries that are executable.
> > >
> > > I'm concerned about adding anything to the default package.  (What if
> > > everyone did that?)
> >
> > I agree. I put it in the default package initially based on some of Jason's earlier
> > comments. However, I then decided that putting anything in the default package was
> > "dangerous". Like you say, "what if everyone did that?" Isn't that defeating the
> > purpose of packages in the first place?
>
> OK, several people have asked the question, "What if everyone did
> that?"  But no one has answered the question.  :-)  I don't yet see the
> problem if everyone did that.  You'd have JARs with Main classes, the
> manifest in each would point at the Main, and you could execute any of
> the jar files with "java -jar foo.jar".  Other JARs might have Main
> classes in the default package, but they would be properly shadowed by
> the Main in the JAR being executed.  There'd be no conflict.
>
> > Jason, I liked your earlier ideas about changing "jdom-info" to a more generic
> > "info" document and filename. I'll make those changes.
>
> Good.
>
> > > > Failing that, would it be preferable to put Main in *some* package?  For
> > > > example: org.jdom.info
> >
> > Good idea.
>
> Nope.
>
> > > That would make it part of JDOM itself.  If it's not in org.jdom it's
> > > ancillary.  In other words, when we write the JDOM spec, this won't be
> > > in there.
> >
> > Why won't it be in there? If it's an issue here, then perhaps it should be in the
> > spec. I mean, perhaps the JDOM spec. should include some way of accessing version
> > information, etc. - a little like convention that most Windows (MS and X) include a
> > Help, About dialog. That really isn't a core part of the product, but it still
> > serves a very valuable purpose.
>
> The standard convention of a README works fine.  I see this as an easter
> egg.
>
> -jh-

After making the changes Jason suggested earlier - namely generalising "jdom-info" to
simply "info", etc. - I now tend to agree with Jason's approach on this. The code is now
- or will be shortly - no longer specific to JDOM, though it does make use of JDOM. It
just requires that the JAR have a META-INF/info.xml file following the same format.

I'll post the code changes later for all to see.

Thanks to everyone for their input to the discussion. I think it's helped - me at least
- flesh out some of the details of this.

Steve



More information about the jdom-interest mailing list