Thursday, June 12, 2008

Experience with Retroweaver!

Develop With 1.5 And Deploy With 1.4!

For a couple of months now I am using a open source project called Retroweaver. The objective of the Retroweaver is to weave JDK 5.0 compiled java class files to run on a JVM1.4.x. It means that the Retroweaver is a bytecode weaver, that enables us to take advantage of the new Java 1.5 language features, while still retaining total binary compatability with 1.4 virtual machines. Retroweaver operates by transforming Java class files compiled by a 1.5 compiler into version 1.4 class files which can then be run on any 1.4 virtual machine. All the generics, annotation support, Enum, varargs, extended 'for' loops, reflect API's etc. which are all features on Java 1.5+ can be now used in Java 1.4.

Very impressive till now. It promises a lot of thing, and most of them do work wonderfully well. Although the concept they use to weave is pretty simple (they mirror all the java class files that are specific to 1.5 and produce 2 jar files. First one is used to weave the 1.5 class files. This runs through all the class files, finds all the instances where 1.5 features/API's are used and replaces by its own API's. Ex: When it finds the statement "import java.lang.annotation.Annotation; ", it replaces it with "import net.sourceforge.retroweaver.java.lang.annotation.Annotation;". The second jar file is the runtime jar file. This contains all the "replica" 1.5 rt.jar files which are not there/modified in 1.4. Pretty simple ah?

Now coming to the other side of the story. Till now I have mentioned all the good features about this product. So let me mention all the negatives about it as well. It is very depressing to see a dormant open source community. I am not sure if many people are actually using this product. Because I myself have encountered many bugs in it, and when I raise these defects, only ONE person always replies (that too delayed response). There are 2 full time developers, no committers that i know of, and no one who keeps a close eye on the forums/mailing list/bug reports. So if you have a bug, you better solve it yourself than wait for them. I have done this a couple of times now, after painfully waiting for 1 month for a reply from them. The other sad part about this product is the code, which is not up to the mark, in the sense that, a 3rd party user can never understand their code( no comments, no java docs).

Overall I am actually not very impressed by this product. Not a product I would recommend any one. There are similar other open source project like the RetroTranslator, which unfortunately faces the same problems. So 2/5 rating for Retroweaver. Don't use it unless you don't have any other alternative.

1 comment:

Safia said...

Is there any alternative of ArrayList in java 1.3. I am creating a J2me app.

HITS SINCE JAN 10th 2009 Hit Counters