Tuesday, April 28, 2009

Building a Lego Castle Incrementally and Interatively

My colleagues Henning Wolf and Arne Roock had a great idea for our company booth at the last JAX conference: Every attendee got a single LEGO brick in his conference pocket. The goal was to jointly build a LEGO castle at the booth, piece by piece, with a huge crowd of developers. So every attendee got a time slot of 30 seconds (a single iteration) to place one or more bricks and/or to refactor the existing building. And we had (and I think the builders, too) a lot of fun with that! Its always fun to work with these creative guys!

Arne and Marcel recorded a stop-motion-movie from the building process, taking a picture after each 30-seconds iteration. The final movie is published at the companies website:
Have fun watching the movie!

JAX 2009 Revisited

My colleague and friend Matthias Lübken wrote with me a short blog-kind-of-a review, reflecting the JAX conference in Mainz last week. Just some thoughts and impressions on OSGi, Scala, Pecha Kucha (and more...) for the next Eclipse-Magazin. The online version is already available here:
But take care, its German... ;-)

Sunday, April 26, 2009

Load-Time Weaving for Spring-DM

Load-time weaving in an OSGi environment is different than in single-classpath-settings like you often have in Java. There you typically use a JVM agent or a specialized classloader that gets ClassFileTransformer components injected from your application. Those ClassFileTransformer components then to the real job of modifying bytecode at load-time. This is also used in the Spring framework to enable aspect weaving or JPA bytecode enhancements.
This gets different when you are working in an OSGi environment. Within OSGi you no longer have a single classpath application, you cannot (or at least should not) create specialized classloaders for yourself to do the magic, maybe the weaving should happen specifically for each bundle or the woven code gets additional dependencies woven into it. Using Spring in an OSGi environment doesn't make things easier. You can use Spring Dynamic Modules to implement really cool OSGi applications, but your Spring load-time weaving support remains broken to some degree (see all the related questions in the Spring-DM forum).
I often thought about using Equinox Aspects to solve these problems. Since Equinox Aspects is not tightly bound to AspectJ weaving only, you could re-use the base infrastructure to hook any kind of bytecode modifier into the Equinox runtime - and reuse the caching of Equinox Aspects at the same time.

Now I have a first sketch implemented that bridges between Spring-LTW and Equinox Aspects. The EquinoxAspectsLoadTimeWeaver class implements the LoadTimeWeaver interface of Spring and can therefore be used in your spring context as the load-time weaver component:


If you define this load-time weaver your bundle need to define an Import-Package on "org.eclipse.equinox.weaving.springweaver", of course.

To use this kind of load-time weaver definition to need to add "org.eclipse.equinox.weaving.hook" (from Equinox Aspects) to your target platform as well as "org.eclipse.equinox.weaving.springweaver":

When you launch your OSGi runtime you need to set the system property: (osgi.framework.extensions=org.eclipse.equinox.weaving.hook) and start the springweaver bundle right at startup. You can do this by adding it to the config.ini file (org.eclipse.equinox.weaving.springweaver@4:start). This is basically the same when using Equinox Aspects, except that you no longer start org.eclipse.equinox.weaving.aspectj but instead the springweaver bundle.

There are still some issues that need to be solved (see this comment in the spring forum for details), but I hope to can try it out and tell me what works fine and what needs some more work.

Feedback always welcome! Enjoy!

Friday, April 24, 2009

JAX 2009: Patterns and Best Practices for Dynamic OSGi Applications

Right after the talk on my lessons learned I had the pleasure to talk together with Kai Tödter and Gerd Wütherich about examples, patterns and some best practices to build real dynamic OSGi applications. Here are the slides:
Kai put together a really nice example for using different ways on how to build dynamics into OSGi apps. It demonstrates all the cool ways of dealing with OSGi services in a declarative way, like Declarative Services, iPojo, Spring Dynamic Modules and Guice/Peaberry. The URL to the example project is on slide 7, if you would like to take a closer look at it.

JAX 2009: Lessons Learned from 5 Years of Building Enterprise OSGi Applications

Yesterday I gave a talk at JAX 2009 about my experiences from using OSGi for enterprise application development over the past 5 years. I tried to sum up my experiences and most of all the mistakes I made during the past years using OSGi. If you are interested, take a look at the slides:
Enjoy - and try to not make the same mistakes than I... ;-)

Wednesday, April 22, 2009

JAX 2009: What's Possible for Web-Apps and OSGi

Today I gave a presentation together with Gerd Wütherich and Peter Roßbach about the difficulties and options you have if you want to adopt OSGi for building web applications. The room was pretty crowded (more than 220 people) and I enjoyed the talk a lot. If you would like to take a look at the slides, you can find them here (unfortunately in German):

Tuesday, April 21, 2009

JAX 2009: What's New in Equinox Aspects

Today I gave an updated version of my EclipseCon short talk on What's New In Equinox Aspects at the Eclipse Forum Europe 2009, here in Mainz. Here are the slides:

Thursday, April 16, 2009

Next version of Scala IDE for Eclipse uses Equinox Aspects

Today Miles Sabin posted details on the upcoming 2.7.4 release of the Scala IDE for Eclipse. I am pretty excited about the fact that it uses Equinox Aspects to implement deeper integration with JDT. It uses the same aspect bundle as AJDT called JDT weaving. Andrew Eisenberg gave a great talk on JDT weaving at EclipseCon 2009. Take a look at the slides if you would like to read more about JDT weaving using Equinox Aspects.