Re: AspectJ and the Plexus core

Jason van Zyl <[email protected]> 03 Jul 2003 22:47:19 -0400
Newsgroups gmane.comp.java.plexus.devel
Organization Zenplex
Message-ID <[email protected]>
On Thu, 2003-07-03 at 09:32, Stephen Haberman wrote:
> On Thu, Jul 03, 2003 at 09:19:07PM -0400, Jason van Zyl wrote:
> > But to answer your question more directly the basic tenet will be
> > that you will be able to morph the container and all of the
> > components you use to suit the requirements of your specific
> > domain.
> 
> Oh yes, I had forgotten you mentioned also being able to apply
> aspects to the container as well. I'm not quite at the level of
> comprehension to where I can truly appreciate that, but it seems
> very nifty. :-)
> 
> > The basic plan is to provide an empty hull that all components
> > will extend. This is really to provide one clean place where you
> > can make any additions you want. So you can add new fields or
> > methods using an aspect and then weave this aspect into all the
> > components by 'filling' up this empty hull so to speak.
> 
> Cool.
> 
> > Your idea is pretty much in line with the general direction we've
> > been moving in and actually a few weeks ago I made reference to
> > the empty hull notion and will implement when I get some time.
> 
> Nice.
> 
> Out of curiousity, I don't mean to question your judgement, I'm just
> interested in your reasoning, have you considering AspectWerkz (or
> Nanning, though I currently favor AspectWerkz)?

Questions are good :-) AspectJ has always been designed to handle
runtime aspects. It is a limitation with the current implementation but
the design is there. You have to remember who we are dealing with.
Gregor Kiczales is one of the leading researchers in AOP and has been
doing it for years in collaboration with many others. But they are a
very practical bunch. They have thought very carefully about the
movement toward AOP practices. I see many of the tools that have popped
up lately as "Johnny comes lately"s.

> It might be nicer with runtime weaving, from my initial read of the
> documentation, plus I'm initially really liking the XML/pure-Java
> combination compared to AspectJ's rather funky syntax that took me
> awhile to get used to in the past.

See, I very much dislike the XML tack. You have zero type safety. They
have thought very carefully about how to introduce AOP concepts and one
of the most important things is make a succint and elegant way to
express joinpoints and pointcuts. A huge amount of work has gone into
the compiler which catches tons of problems which you simply cannot do
with the XML+Java variants of AOP. As far as I'm concerned the design of
AspectJ is heads and shoulders above anything else. I think AspectWerkz
is the best of the other tools but these other tools just don't have the
experience that Gregor and the other AspectJ folks have. Gregor has been
doing this stuff for years and he's not a slacker. He's not complacent
and is always looking for ways to improve. And user suggestions have
made their way into the language and there is a lot of dialog amongst
users and the developers and the language has improved. To me there is
no comparison. I can wait until the runtime stuff works completely and
there are ways around it right now.

> Mainly I ask because I understand you're busy and so might within
> the next few weeks play with applying runtime aspects to our app in
> a much simpler, less elegant, hard coded way that a nifty
> generalized container like plexus, and was planning to use
> AspectWerkz.

You really have to ask yourself if you really need runtime aspects. I
think in most cases you can get away without them for the most part. And
if you need them right now you can just compile them all in and use
runtime properties to trigger them.

> If you've already found a good reason not to use AspectWerkz, I'd
> default back to AspectJ. 

I will not use anything that uses XML to describe joinpoints and
pointcuts. And there simply isn't anything that comes close to AspectJ's
expressiveness at defining joinpoints and pointcuts. Yes, there is some
new syntax but to me it belongs in the language where you can catch
mistakes with the compiler.

> If you just haven't had time or desire to
> look at it, that's certainly fine as well. I've just been pleasantly
> surprised at just now finding the two open-source AOP frameworks
> this week and wondering how mature/reliable/nifty they are.

There are tons of them now but I don't think I'll ever be swayed from
AspectJ.

> Thanks,
> Stephen
> 
> _______________________________________________
> Plexus-dev mailing list
> [email protected]
> http://lists.codehaus.org/mailman/listinfo/plexus-dev
-- 
jvz.

Jason van Zyl
[email protected]
http://tambora.zenplex.org

In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.
  
  -- Jacques Ellul, The Technological Society