Yes! I spent some time talking about this, and this was one of the "far
out" scenarios that I presented at the AOSD conference.

There are some limitations that need to be enforced, of course:

1) That the local var was never passed as a parameter to another method.

2) That the local var was never assigned to a field.

Technically you could walk the call-graph of 1) to ensure that it is
never assigned to a field, but that could be a nasty computational
rat-hole.

Some kind of weave-time warning could be issued if either of those two
constraints are violated.

Cheers,

-John
http://www.iunknown.com


-----Original Message-----
From: Marsh, Drew [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, May 29, 2002 11:21 PM
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET] Aspects as diagnostic probes, WAS: RE: Re: [DOT
NET] AOP to police thread affinity?

John Lam [mailto:[EMAIL PROTECTED]] wrote:

> Do folks have other interesting ideas for aspects as
> diagnostic probes?

Uhh... here's a cool one that would probably win you unimaginable
amounts of
praise from the deterministic finalization crowd. How about an aspect
that
is executed after a woven method that ensures that all local variables
which
support IDisposable and are whose references are not already null are
reported and/or automagically Dispose()d of?

The reason I say "and are whose references are not already null" is
because
there's unfortunately no other abstract indicator as to whether or not
an
IDisposable object has truly been disposed of. Personally I think
IDisposable should support an abstract read-only Disposed property that
returns true/false based on whether or not the object has been in fact
been
properly disposed of.

Later,
Drew

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to