Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] Stateful JoinPoints

"David" == David J Pearce <d.pearce@xxxxxxxxxxxx> writes:

	David> I am wondering if there is any interest in permitting
	David> JoinPoint.StaticPart instances to contain state in AspectJ and,
	David> indeed, if it is even possible.  The idea would be to allow
	David> extending the JoinPoint.StaticPart class to include whatever
	David> state was necessary.  Then, from within an advice, this state
	David> could be accessed via a downcast.

Does AspectJ actually guarantee anything about the identity of the static part
object?  (I don't know.)  For example, is an implementation free to generate a
new static part object each time a corresponding dynamic join point is reached?
If so, then you couldn't effectively attach application state to the static
part object.

My opinion, in sum: yours is an interesting idea, but I'm not sure that it is
better than a dynamic test on other data objects in the corresponding pointcut.
I guess it could save you the trouble of hashing to find your own data, but
doing your own hash isn't so hard.

Moreover, implementing a map from join point objects to application-specific
data is (inherently) an application-specific task, and so AspectJ "shouldn't"
implement such a map: whatever it did, it would be good for some applications
and not so good for others.

Eric.

-- 
-------------------------------------------------------------------------------
Eric Eide <eeide@xxxxxxxxxxx>  .         University of Utah School of Computing
http://www.cs.utah.edu/~eeide/ . +1 (801) 585-5512 voice, +1 (801) 581-5843 FAX


Back to the top