Skip to main content

JSR 175, JBoss and AOP

Posted by johnreynolds on February 25, 2004 at 6:51 AM PST

Marc Fleury came to Austin this week and took the opportunity to speak at the monthly Austin JUG meeting. This was the first time that I'd heard Marc Fleury in person, and I am happy to say that he's rather entertaining. The meeting was standing room only, and before I knew it I had spent two and a half hours on my feet listening to his vision of the future of JBoss and Java.

It's a darn good vision.

Fleury's web presence has always seemed a bit abrasive to me, but "in the flesh" he is self-deprecating and readily willing to give credit where credit is due. He readily admits stealing every good idea he comes across if it can help make JBoss better, and based on what he presented at the Austin JUG he'd be in for serious jail time if purloining good ideas was a felony.

Of most interest to me are the plans in JBoss 4 to support the declaration of aspects through the use of metadata (initially XDoclet tags, transitioning to JSR 175 metadata when the spec is released).

The JBoss platform has always provided services for object persistence, remote access, and transaction support as have all J2EE app servers, it's called supporting the EJB spec. With the introduction of JBoss 4 these services will be decoupled from each other, and they will be made available to developers on a mix and match basis, only use the services (aspects) that you need. For example, if all you want is persistence for a Plain Old Java Object (POJO), JBoss will provide it.

As with all good ideas, decoupling the aspects of EJBs seems so obvious that one wonders how all the complexity of EJB ever got rolled into one package in the first place. This is certainly a step in the right direction.

Much to my relief the mechanism JBoss will use to specify aspects is also an improvement. Rather then introducing yet more complexity to the plethora of XML configuration files, JBoss will let you specify the aspects that you want on a class by class, field by field basis through the use of XDoclet tags. The declaration of the aspects that you want for your objects will be in the source code, not in a seperate XML document that you have to track down and maintain.

Here's an example from the JBoss site for defining transaction aspects on a method:

   /**
    * @jboss-aop.metadata group="transaction" trans-attribute="Required"
    */
   public void someMethod()
   {
   }

Fleury also announced that you will be able to precompile JBoss aspects into your class files. Classes with embedded JBoss aspects will be deployable and executable on other J2EE app servers such as BEA's WebLogic. If they can pull that off I will be ecstatic. If features aren't portable they aren't nearly as interesting to me.

Fleury and the JBoss team have made a lot of promises. I for one wish them all the luck in the world in fulfilling those promises.

For more info on JBoss AOP, follow this link...