Discussions

News: backport175 - a backport of Java 5 annotations for Java

  1. backport175 is a backport of the Java 5 annotations (JSR-175) specification. This open source package from Codehaus aims to make strongly typed annotation available for Java 1.3/1.4 platforms. They are bytecode compatible with Java 5 annotations making them available for use by tools etc.

    backport175 - a backport of Java 5 annotations for Java < 1.5

    Threaded Messages (10)

  2. rock on codehaus[ Go to top ]

    codehaus is really taking off these days. this looks pretty useful. now if i can just go without sleep, I can play with it.
  3. retroweaver[ Go to top ]

    Has anybody used retroweaver at all?
  4. retroweaver[ Go to top ]

    Has anybody used retroweaver at all?

    Hi Bill,

    1) Retroweaver doesn't currently make annotations available to 1.4 code at runtime. It does leave the annotations in the class file, so bytecode processors can still work fine with the transformed 1.4 class files. If someone needs 1.4 runtime support for annotations, I would handle it differently than backport175, by making them transparently usable: Instead of requiring users to write to my 3rd party API to access the annotations, their existing 1.5 annotation code would work transparently in 1.4. I haven't really had any requests for runtime annotation support, so this has been on the back-burner.

    2) Retroweaver has had many happy users (Resin, MapInfo, BMC, ScheduleWorld... to name a few off the top of my head). I've been meaning to put up a web page with some "testimonials", but I just haven't had the time to get around to it. Here are a couple of quotes I just dug up from ny inbox...

    God bless,
    -Toby Reyelts
    - We have been using the Retroweaver in all our new projects for the last 3 months without encountering any problems.

    - We can now use JDK 5 features in our code and deploy on J2EE servers.
     
    Thanks for the great product.

    Aryeh Sivan
    Technical Leader - Java & Web Technologies
    Idm BU
    BMC Software
    "My name is Gunnar Grim and I work as a developer/architect for the software consultancy firm Know IT Karlstad AB. I am responsible for a class library/framework called DOI, that we use to develop rich Swing-based clients and J2EE server applications. This framework benefits a lot from Generics, both by improved compile time checking but even more importantly by making the source and API-docs easier to understand for the developers using DOI. Still, until recently I haven't been able to use Generics because the server applications must be deployable on application servers that does not yet run on Tiger. So when I came across a reference to RetroWeaver on a NetBeans forum I didn't hesitate to try it out. To my surprise I must admit (I've been in the business for more than 20 years) it worked perfectly! The first class I ported was my base class of all session beans, which uses a couple of caches for home interfaces and such, so it was a good candidate to try out with since any problem caused by RetroWeaver would show up immediately. I am happy to say that none has! I have since then ported quite a few framework classes to use Generics, enhanced for-loop etc, and we are deploying server applications on Sun Application Server running on JDK 1.4.2 as well as client applications distributed by Java WebStart, also on JDK 1.4.2. I can only recommend everyone to just dive in and start using Generics today!"
  5. retroweaver[ Go to top ]

    Has anybody used retroweaver at all?
    Hi Bill,1) Retroweaver doesn't currently make annotations available to 1.4 code at runtime. It does leave the annotations in the class file

    Does it distinguish between RUNTIME and CLASS (Visible/Invisible)? I already have an abstraction for reading annotations using Javassist, so that's not a problem. We may also be interested in contributing.

    I'll see if I can find your email so we can talk directly.

    Bill
  6. Compile plugins[ Go to top ]

    Great idea, especially the Jdk1.5 compatibility.

    But.

    Ah.

    Now I have the AspectJ compiler and the AnnotationC compiler. Can I use both on the same java file? I do not think so.

    I once read an article about a compiler that allowed plugins that added functionality during compile. I say it is time for javac to become pluggable. Just add a jar to the classpath and hoppa.
  7. Compile plugins[ Go to top ]

    Or maybe someone can add a plugin layer on top of javac so others can plugin?
  8. Make TestNG use this lib[ Go to top ]

    Would be nice to make TestNG to use this lib. Now Test NG supports only 1.4 /1.5, but with this lib can even support 1.3!
  9. retroweaver / backport175[ Go to top ]

    I think we target a rather different thing. Backport175 aims at providing you with a backport of JSR-175 ie focus only on annotations, including runtime access to them. When using Backport175, you will stick to your old Java 1.3, 1.4 environment, compilation etc. You don't need the JDK 5 at all (or IDE that supports it and a team that knows JDK 5).

    Backport175 provides you the guarantee that migration effort to Java 5 annotations will be minimal, and that tools making use of Java 5 annotations (like AOP) can make use of your old doclet Java 1.4 annotations right now (while not relying on those tools).

    If your are stuck in a team with Eclipse 3.0, Java 1.4, WebLogic WorkShop 8.x etc, we provide you with plugins and Ant task, and you won't have too change your tools.

    From what I understand, retroweaver requires you to work and compile with Java 5 and then provides you a way to ship your project so that it runs on Java 1.4 (write once..).
    That's a great thing, but quite different. There seems to be some risk as well around use of reflection I suppose (can't read those in the docs) and off course the java.lang.annotation.* runtime access.

    As regards AspectJ integration, yes we have that in the roadmap. Backport175 is born from ideas we had implemented in AspectWerkz, and will be a way to have the new annotation style aspects of AspectJ 5 working on Java 1.3/1.4.

    Alex
  10. retroweaver / backport175[ Go to top ]

    I think we target a rather different thing. Backport175 aims at providing you with a backport of JSR-175 ie focus only on annotations, including runtime access to them. When using Backport175, you will stick to your old Java 1.3, 1.4 environment, compilation etc. You don't need the JDK 5 at all (or IDE that supports it and a team that knows JDK 5).Backport175 provides you the guarantee that migration effort to Java 5 annotations will be minimal, and that tools making use of Java 5 annotations (like AOP) can make use of your old doclet Java 1.4 annotations right now (while not relying on those tools)....

    Alex, it would be handy to have some quick fixes for Eclipse that would convert JavaDoc annotation into Java5 and other way around.
  11. Make TestNG use this lib[ Go to top ]

    Would be nice to make TestNG to use this lib. Now Test NG supports only 1.4 /1.5, but with this lib can even support 1.3!

    :-)

    Right, concretely, Backport would allow you to annotate your TestNG tests with JavaDoc but in the end, have a jar file of your tests with 1.5 annotations in it.

    I would recommend using the converter tool, so that you entire code base gets converted to 1.5 instead of this hybrid approach, but we'll see if there's demand for such a feature.

    --
    Cedric