In reading the Oct'01 issue of Communications of the ACM, I find myself
intrigued by the concept of aspect oriented programming (AOP). The basic
idea is that some methods in an object tree have simillar concerns even
though they are in different objects. AOP is an attempt to make such
"crosscutting concerns" more easily identifiable and provide them with
the means to access required data, execute code when appropriate, etc.

I think calling this "AOP" might over-emphasise its usefulness, but
I could easily see a number of places where I would want some way to tag
multiple methods in different classes so that they had common behaviors.

If we're to add some kind of data hiding to Perl6, then perhaps this
is the right time to also add some AOP concepts.

        Class classa is concerned('classx');
        sub .amethod ($a,$b) concerns classx.y {
                # ...
        } concerns classx.z;

        Class classb is concerned('classx');
        sub .bmethod ($c,$d) concerns classx.y {
                # ...
        } concerns classx.z;

        Class classx;
        sub .y () {
                # This gets called before classa.amtheod and
                # classb.bmethod and can access the internals
                # of the object's state.
        }
        sub .x () {
                # This gets called after classa.amethod and
                # classb.bmethod and can access the internals
                # of the object's state.
        }

All of this is still coming into focus for me, and I want to spend
more time reading the articles later, but for now I just wanted
to see if anyone else has been thinking these thoughts....

-- 
Aaron Sherman
[EMAIL PROTECTED]             finger [EMAIL PROTECTED] for GPG info. Fingerprint:
www.ajs.com/~ajs        6DC1 F67A B9FB 2FBA D04C  619E FC35 5713 2676 CEAF
  "Write your letters in the sand for the day I'll take your hand
   In the land that our grandchildren knew." -Queen/_'39_

Reply via email to