AOP and Ruby

  • Thread starter Luís Miguel Lourenço
  • Start date
L

Luís Miguel Lourenço

Hello,

I'm working with some friends on an AOP comparison across several=20
programming languages. We're doing this as a small project for a=20
college course. We want to talk about AOP and how it's been implemented=20=

in various languages, it's influence on them and how it's being=20
accepted by their various communities.

We've chosen Ruby as one of the languages. Java and C++ are the other=20
ones. This seemed like a good idea since they stand at different levels=20=

of dynamism. Dynamism as in metaclasses, reflection, open classes,=20
eval, etc.

I've searched the mailing list archives and googled for information=20
about AOP and Ruby, but haven't come up with much. AspectR seems to=20
have been abandoned. I did find a proposal for AOP in Ruby up at=20
RubyGarden. Not much more though. Can someone give us some pointers to=20=

more information? My impression is that there isn't much interest in=20
AOP from the Ruby community in general.

I'm somewhat convinced that Ruby, compared to many other languages,=20
enables one to effectively cut back tremendously on code scattering,=20
with it's reflection capabilities, metaclasses, eval, etc. But from=20
what I've understood from AOP it aims to bring direct semantics to code=20=

that crosscuts a program. So, I'm not sure the techniques used in Ruby=20=

would qualify as AOP. I have however seen an interesting quote by Dave=20=

Thomas (http://c2.com/cgi/wiki?AspectsAndDynamicLanguages) in which he=20=

says "Once you have decent reflection and metaclasses, AOP is just part=20=

of the language.". I'm not sure I agree with it. I agree in the sense=20
that I can probably avoid code scattering using Ruby, I don't agree=20
because I have to think in terms of metaclasses, method aliasing,=20
reflection and whatnot to get the code in there. I don't know how big a=20=

deal that is. Or if it is a deal at all. Any thoughts on this?

Lu=EDs Miguel Louren=E7o=09=
 
J

Jim Weirich

Luís Miguel Lourenço 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.
 
T

Trans

After creating numerous implementations of varyng degrees of capability
in this regard I can tell you from experience: It is possible to do AOP
in Ruby utilizing reflection and metaclasses, but it certinaly isn't
convenient nor generally efficient, and for obvious reasons. These
features were not designed with AOP in mind.

So what are you after exactly? Are you in search of an active AOP
implementaiton other then AspectR? Or how to AOP in Ruby "as-is" with
its current meta-features. Or somehing more general? I may be able to
provide some answers, more or less.

T.
 
C

Caio Tiago Oliveira

Luís Miguel Lourenço, 24-05-2005 14:03:
Hello,

I'm working with some friends on an AOP comparison across several
programming languages. [snip]

I've searched the mailing list archives and googled for information
about AOP and Ruby, but haven't come up with much. AspectR seems to have
been abandoned. I did find a proposal for AOP in Ruby up at RubyGarden.
Not much more though.
[snip]


http://rubygarden.com/ruby?AspectOrientedRuby
 
L

Lionel Thiry

Luís Miguel Lourenço a écrit :
Hello,

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.

We've chosen Ruby as one of the languages. Java and C++ are the other
ones. This seemed like a good idea since they stand at different levels
of dynamism. Dynamism as in metaclasses, reflection, open classes, eval,
etc.

I've searched the mailing list archives and googled for information
about AOP and Ruby, but haven't come up with much. AspectR seems to have
been abandoned. I did find a proposal for AOP in Ruby up at RubyGarden.
Not much more though. Can someone give us some pointers to more
information? My impression is that there isn't much interest in AOP from
the Ruby community in general.

I'm somewhat convinced that Ruby, compared to many other languages,
enables one to effectively cut back tremendously on code scattering,
with it's reflection capabilities, metaclasses, eval, etc. But from what
I've understood from AOP it aims to bring direct semantics to code that
crosscuts a program. So, I'm not sure the techniques used in Ruby would
qualify as AOP. I have however seen an interesting quote by Dave Thomas
(http://c2.com/cgi/wiki?AspectsAndDynamicLanguages) 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. I agree in the sense that
I can probably avoid code scattering using Ruby, I don't agree because I
have to think in terms of metaclasses, method aliasing, reflection and
whatnot to get the code in there. I don't know how big a deal that is.
Or if it is a deal at all. Any thoughts on this?

Luís Miguel Lourenço

Had a sight at Objectteams ruby?

http://www.objectteams.org/README.rot

http://sourceforge.net/projects/robjectteam/

Good work! :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Ruby and AOP 6
ruby and aop 9
AOP and debugging 0
Perspectives for Ruby 2.0 8
[ANN] [RCR] Cut-based AOP 77
The likes of AOP (1 of 2) 1
metaclass in python, role in perl and AOP in ruby 4
AOP bigger picture 3

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top