Re: AspectJ and WebObjects?

From: Kaelin Colclasure (kaeli..cm.org)
Date: Wed Dec 24 2003 - 10:24:55 EST

  • Next message: Kamal Shah: "Images in WOComponent bound to 'filename' not being displayed"

    On Tuesday, December 23, 2003, at 05:30 PM, Harald Niesche wrote:

    > Kaelin Colclasure wrote:
    >> It has occurred to me on several occasions that AspectJ might be an
    >> invaluable tool for learning the ins and outs of WebObjects.
    >
    > Sounds interesting, what's your plan?

    In general, I'm interested in gaining insight into how the internals of
    WebObjects and Enterprise Objects work. More specifically, I hope to be
    able to trace all of the methods invoked in particular use-cases so
    that I can wring the most value out of the frameworks. One of the
    things I most admire about WebObjects is the degree to which useful
    functionality is exposed, even if it's not required by "mainstream" Web
    development tasks.

    For example, some time back I was able to utilize EOF's model metadata
    and SQL generation in a scenario (bulk data queries returning millions
    of rows) for which the higher layers of EOF are unsuited. This required
    a lot of reading between the lines of the documentation, stepping in
    the debugger, and expert advice from this forum. A lot of the necessary
    information could have been more quickly and easily gleaned from an
    execution trace of a few key EOF collaborations.

    >> Has anyone on these lists experimented with this? I've just tried
    >> installing the latest (1.1.4) AJDT Eclipse plugin, but it
    >> unfortunately does not seem to play well with WOLips.:
    >> !ENTRY org.eclipse.ajdt.ui 4 0 Dec 22, 2003 21:22:08.892
    >> !MESSAGE Compile failed.
    >> !STACK 0
    >> java.lang.NullPointerException
    >> at
    >> org.eclipse.ajdt.internal.ui.ajde.ProjectProperties.getClasspath(Proje
    >> ct Properties.java:206)
    >> at
    >> org.eclipse.ajdt.internal.builder.Builder.build(Builder.java:150)
    > ...
    >> I suspect that this is because WOLips has its own Builder classes (I
    >> believe) which (presumably) handle classpath metadata differently
    >> from the standard Eclipse Builder.
    >
    > WOLips has it's own builders, yes, but it does not handle the
    > classpath differently ...

    As noted in a couple of earlier responses, it may be the WO Frameworks
    classpath container that's breaking the ajc task. I plan to experiment
    and try to confirm this tomorrow.

    >> Using the AspectJ Ant tasks also seems to be a non-starter. It's
    >> designed as essentially a drop-in replacement for the javac Ant task
    >> -- but again, WOProject Ant build files do not use the javac task.
    >> Compiling is apparently all handled in the bowels of the
    >> woapplication or woframework tasks instead. While this does make the
    >> build files substantially more concise, it would appear to also make
    >> it impossible to use alternative Java compilers in conjunction with
    >> WOProject... Or is there (hopefully) something I'm missing?
    >
    > ... and the ant files generated by WOLips don't contain a javac task
    > because the classes are compiled by the standard Eclipse Java
    > compiler, the ant builder and the incremental builder mostly just copy
    > stuff.

    Yes, I was missing that crucial point. :-) I can see the benefits of
    this approach, but it was not what I was expecting -- I had been
    operating under the impression that the build.xml scripts would be
    usable for command-line Ant builds. (And of course they could be -- if
    you add the necessary javac task, etc.)

    This is actually promising, in that if nothing else I should be able to
    use the Ant task(s) provided with AspectJ to build with aspects on.

    > Did you try a simple AspectJ project in your Eclipse installation? If
    > you create a new AspectJ project (instead of a WOLips project), no
    > part of WOLips should be involved and failure to build your project
    > would probably be caused by the ajdt plugins ...

    I did indeed -- and it worked fine (as far as I tested). AJDT is quite
    cool, and seems quite usable in its current state despite the absence
    of a few refinements. (Most notably, it disables incremental builds by
    default, which consequently disables a lot of Eclipse's real-time error
    / warning feedback.)

    -- Kaelin

    > Harald
    >



    This archive was generated by hypermail 2.0.0 : Wed Dec 24 2003 - 10:24:51 EST