Hi Jeremi,
On Feb 4, 2007, at 4:44 PM, jeremi joslin wrote:
On 2/3/07, Vincent Massol <vincent(a)massol.net>
wrote:
Hi Jeremi,
I'm +1 on my side but as you voted -1 we'll need to convince you to
change your vote ;-) Let me give it a try below...
On Feb 3, 2007, at 9:41 AM, jeremi joslin wrote:
Hi,
-1
I'm not for changing to jar. it's not a Java archive, it's an XWiki
Archive. I don't see the point to change. People will think it's
javacode.
* JAR is an archive format. It can be used for lots of different
things. There are even software that use JARs for their installation.
yes, but a
JAR in java term is a zip. There is also JAR compression
method. so if you go this way, it's the same problem.
A JAR isn't a Zip in Java term. It's using the same compression
algorithm. It's very different in term of metadata. I won't go in
more details but you can check the JAR specification to know more
about this.
* I really believe that in the future our
applications will not be
made only of XML files but will also contain other libraries (jar
files) and java classes. For example imagine the IRC bot application.
There are some xwiki pages but we also need the picoirc jar. We'll
need to bundle all that together.
And what's wrong with putting a jar inside a
xar? even if we use a
jar, it will only be readable by XWiki.
It's possible but harder. For example to read a JAR inside a XAR
you'll probably need to write and register special handlers against
various classes (such as URL factories, etc).
No, xwiki isn't the only one. All tools will be able to read a JAR or
a ZIP (be them IDE, build tools, desktop tools, etc).
* XWiki is a
Java application so all users are familiar with the JAR
format.
But it's not a normal jar. That will lead to misunderstanding.
I'm not sure what you call a normal jar :-) You probably means
classes. However a JAR is not meant to contain only classes. It's a
generic format to contain any other kind of resources. The nice thing
it has though is support for dependencies and class-paths.
Of course we
can use the XAR format for that. XAR looks nice because
there's XWiki inside but there's a cost of inventing a new archive
format:
* It needs to be described
* There needs to be tools for it (or people need to rename it to
zip...). BTW if it's a zip we might as well name it zip... The
problem with Zip is that it does not support meta data information
such as the jar format does. And we need these... And there are APIs
to get these metadata so we don't have to reimplement all the code
(as we've done for the package.xml file).
* It makes it difficult for the build (this is the same argument as
above with tools) as all the existing plugins do not understand the
XAR format so we have to reinvent all the tools... This is why I had
to implement the xar handler and the xar plugin in our repository. It
would make it much easier if it were an existing format such as JAR.
Why not renaming the xar to the zip. it's just that people don't need
to know what is inside, but if they want they can.
As I said renaming to zip is a solution. Probably a better one than
the current XAR. However the pity is that a zip doesn't support
metadata by default. You need to define them, document them, teach
them, write parsers for them, etc. JARs have this already (this is
called the Manifest).
I dont see the point, we are using an API for reading
and writing the
metadata: XML. We will also need to reimplement the writing of
metadata in the manifest file.
No. The JDK provides an API for reading information from the manifest.
So it's already done isn't it?
And it's possibly buggy :-) And you're the only one who knows about
it. And it isn't documented. And you haven't implemented it for
Maven2 (it's not easy and has some issues) nor any of the tool that
will crop up.
The question is not that it's done (it's not finished BTW - No doc,
no tests). It's about removing code and using standards (to reduce
cost even further). Any line of code that is removed saves a lot
(fixing bug, documentation, test, teaching, etc).
I think it would be much better to use an existing format (which we
do except we're using Zip instead of JAR), already documented rather
than invent a new one. There's no point in us hiding the underlying
format we use by changing the extension. We might as well use that
format's extension...
Ok, rename it to zip if you prefer, that's only a
problem the
extension to be xar for openning it under windows
No that's not true. It's a problem for a lot of tools (Maven2
included). BTW I'm on Mac OS X (which isn't windows) and I can't open
a XAR either. I have to rename it to ZIP before... Unfortunately
there are very few tools that look inside a file to know what format
it is. Most will simply look at the file extension.
. But i prefer
people to think it's a file where they have all there pages, and don't
need to read what is inside. But if they want, they can.
Sure that's ideal. Problem is that you always have to do this... For
example there's no selective export so you have to expand it as a
zip, remove files, edit the package.xml file and repackage.
if you look at this page :
http://filext.com/detaillist.php?extdetail=XAR there is some other
software who are using this extension. So why XWiki can't use it?
Some people have thrown nuclear bombs in the past. Is that a good
reason for others to do it? Probably not.
It's not because people are doing bad things that we have to follow
them ;-)
So why changing to the jar format? ;-)
Oh, because I think it's an improvement (it certainly is at least for
issues I have with Maven2 and it'll win us hundreds of lines of
code). See below for explanations on lightweight container support.
And even the xar format is not so used. I ask to my
friends, no one
know it. Did you know it before? I thing changing to the jar format
will bring more misunderstanding.
I didn't know about the other XAR format and it wouldn't be a good
choice (not known enough and thus not enough tool support).
I'm not going to push for the format change because we have a lot of
work to be done right now and I'm not proposing to do it myself
either. What I was just saying here is that I agree that inventing a
format is probably not the best solution and reusing an existing well-
known format with metadata support is probably a better choice. JAR
is such a choice. It looks to me like a good choice, especially
considering that we have a need to put java classes in applications.
I see you're against it. That's fine. It means it's not a clear cut
decision and we should think more about it. In any case as I said
above we have more urgent problems. We'll need to revisit this when
we move to full fledge application support. These will contain:
- pages
- java classes (plugins, macros, etc)
- external libs
- resources (HTML, js files, images, etc).
For example a GWT XWiki application will contain java and resources +
the necessary pages and possibly external libs (we'll probably bundle
them though). The IRC Bot will require an external lib for sure.
We need to revisit this in view with the new architecture (component-
based architecture based on a microkernel, aka lightweight
container). You'll see that most of these containers use the JAR
format (OSGi, Plexus, etc) so we'll probably have to use the JAR
format anyway... :-)
Thanks
-Vincent
___________________________________________________________________________
Yahoo! Mail r�invente le mail ! D�couvrez le nouveau Yahoo! Mail et son interface
r�volutionnaire.
http://fr.mail.yahoo.com