Lu¨ď Miguel LourenÝđ said:
> I'm working with some friends on an AOP comparison across several
> programming languages. We're doing this as a small project for a
> college course. We want to talk about AOP and how it's been implemented
> in various languages, it's influence on them and how it's being
> accepted by their various communities.
> [...] interesting quote by Dave Thomas [...] in which he
> says "Once you have decent reflection and metaclasses, AOP is just part
> of the language.". I'm not sure I agree with it. [...]
What an interesting project, I wish you luck.
I have a (non-ruby) friend who is very interested in AOP. He and I have
talked about this on and off about AOP in a language like Ruby. My
position is very similar to Dave Thomas's that you quoted above. Once you
have powerful meta programming abilities in a language, the AOP becomes
pretty straight forward.
Here's a thought. One can think of AOP as a Domain Specific Language for
doing a limited set of metaprogramming operations. Since Ruby is
recognized as fairly good language to use to implement DSLs, so using Ruby
directly to do AOP stuff isn't a far stretch.
Another data point. AspectR provides a large percentage of AOP
capability. Its only around 200 lines of code! Compare that to AOP in
Java or C++ aspect lanaguages and you begin to get a feel for how easy AOP
is in Ruby.
One final suggestion: Propose a couple AOP like operations that you would
like to see. Then implement them in Ruby and compare it to the
implementation in Java/C++. I would like to see some of the operations
you would suggest.
--
-- Jim Weirich jim / weirichhouse.org http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)