[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [aspectj-users] declare parents syntax
- From: Eugene Kuleshov <eu@xxxxxxxx>
- Date: Fri, 29 Sep 2006 14:04:11 -0400
- Delivered-to: firstname.lastname@example.org
- User-agent: Thunderbird 220.127.116.11 (Windows/20060909)
Thanks Ron, I know that. But the thing is that the same pattern is
used in pointcuts to apply additional aspects to the very same classes.
Hence a duplication that may lead to some unexpected typos.
Ron Bodkin wrote:
declare parents accepts a type pattern, not a pointcut. A type pattern picks
out types, whereas a pointcut picks out join points. The expression inside a
within pointcut are is a type pattern.
Here's an example of using declare parents to match a type pattern, which is
surely what you wanted to do with within:
declare parents: com.xyz..* implements XyzType;
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Eugene Kuleshov
Sent: Thursday, September 28, 2006 12:06 PM
Subject: [aspectj-users] declare parents syntax
I wonder why "declare parents" introduction syntax does not allow to
use within(*) pointcut expression?
This limitation lead to significant amount of duplication in the
aspect code and/or makes xml-based aspect definitions more verbose. The
only workaround I know is to "bridge" trough annotation introduction,
but that approach does not work on 1.4 and looks like a hack.
I thought I saw that it was possible to use within pointcuts for this
in some old version of AspectJ but it was removed. I might be mistaken