ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Aspect-Oriented Programming and JBoss
Subject:   Answering your well-founded skeptism
Date:   2003-05-30 07:22:47
From:   patriot1burke
Response to: Answering your well-founded skeptism

""Will you be able to determine what is actually going on?" - I can see it right now. A couple of months into the the project everyone is happy. AOP is running cool and snappy. Then at crunch time when the bugs are flying around like mad people will be banging their heads into walls trying to figure out "what is actually going on", and ripping out aspects left and right to get back to "real code"."


We've written a GUI management console so that you can see what aspects have been applied to any given class at runtime. Many of the aspects we're writing for JB4 are triggered by metatags declared using XDoclet tags right in the source. GUI + declarative XDoclet tags bring aspects out right in the open.


"I just looked up "Apsect Oriented Programming" on the MSDN, "No Topics Found"."


You didn't look hard enough. http://msdn.microsoft.com/msdnmag/issues/02/03/AOP/default.aspx


"* Maintenance programmers won't know AOP from ASP and will reak havoc.
* Engineers will forget the aspects because they aren't right in their face, and will spend days searching for bugs in one class when they are really in an aspect in some other distant corner of the program.
* You can be working on a system without robust unit tests (like 99% of the systems in production) change an aspect and break pieces of the code you didn't even know about.
* I can imagine having to impose and 'aspect lockdown' well in advance of a code freeze so that system wide changes are not made close to release."


PLEASE! Replace aspect or AOP with your favorite methodology (OOP etc..), acronym (EJB, CORBA), or language (C++, Python, Java) and you can apply the generalized statements you make above really to anything in software development.


But other statements, I will address.


"* You can have hairy aspect ordering problems."


Yes this is an issue. JBoss AOP provides some mechanisms for this, other AOP frameworks do the same. Go to our website or another AOP frameworks' website.


"* There are issues getting aspects to talk between each other."


Not a problem with JBoss AOP at least with a single full remote or local invocation which is why we have an Invocation and InvocationResponse object in the first place. ThreadLocals are also useful as well.


"* Aspects can cross component boundaries freely, with adverse effect."


Then don't use a regular expression to apply your aspects and/or rely on pointcuts triggered by metatags. Apply aspects declaratively on a per-class basis.


Although this is non-documented, in JBoss AOP we are also experimenting with the idea of an abstract AOP container so that pointcuts can be applied across groups of different instances rather than forcing pointcuts at the class level.


One of the things I wanted to drive JBoss AOP is real-world requirements. I want all functionality of JBoss AOP to be driven by use cases, not some academic ivory tower phd thesis. JBoss 4 implements a bunch of powerful aspects that have actually driven the underlying framework itself. We are currently using it also to implement EJB caching and optimized HTTP session replication. In other words, we are eating our own lunch.


I'm sorry the article did not meet your expectations. Personally, I need to see some simple examples in action before I can really understand how something can be used. When opening a tech book, I usually skip the BS in the first few chapters and go directly to the meat, but that's just me. Spare me the "blah blah blah", just show me the damn code!


On a side note, its funny. Recently, we were talking to an AOP expert who generally writes articles and papers on AOP about reviewing and making suggestions on our codebase, his response was "I'm allergic to code." I'll leave the "conceptual and architecture article"s to those allergic to code.


All and all, thanks for the exercise. Its good practice and helps me refine the message.


Bill


1 to 1 of 1
  1. Answering your well-founded skeptism
    2003-05-30 10:48:53  anonymous2 [View]

1 to 1 of 1