Hooks, aspect-oriented programming, and design by contract

Alex Martelli aleax at aleax.it
Wed Jan 23 10:42:53 EST 2002


"Luigi Ballabio" <ballabio at mac.com> wrote in message
news:mailman.1011797414.9439.python-list at python.org...
> At 02:11 PM 1/23/02 +0100, Alex Martelli wrote:
> >I see no reason in Python why said object
> >should necessarily be a class, at least in Python and other languages
> >allowing independent alterations to instances (I think Ruby does that,
> >and I wonder if Aspect/R supports only class-level, or also instance
> >level, aspecting/augmenting).
>
> Hi,
>          it does support class or instance augmenting transparently, i.e.,
>
> aspect.wrap(SomeClass,precond,postcond,methods)
>
> and
>
> aspect.wrap(instance,precond,postcond,methods)
>
> do what you would expect.

Thanks.  Assuming Aspect/R is designed by AOP-knowledgeable experts,
this confirms my gut feeling that instance-level as well as class-level
aspect augmentation may be of interest (in an otherwise dynamic lang,
such as Python or Ruby, of course).


Alex






More information about the Python-list mailing list