Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Intertype declaration name mangling - for or against?

Andy,

I'm all for this. It's something that I've thought about requesting in the past but since I have some other ITD features that I'm slightly more interested in like the new ITD syntax (I noticed the update to the bug today, good stuff) and the ability to invoke super.method() when overriding a method introduced via ITD, I figured it could wait . Anyway, I think this absolutely would help ITDs work in a more seamless manner with various frameworks that do a lot of reflection (JPA, Seam, Spring, etc). It would be fine whether this was done by annotation (possibly something like: @Asis intertype ITDInterface{ } ?) or it became the default (maybe turned of via an annotation?).

On Nov 19, 2009, at 1:54 PM, Andy Clement wrote:

I'm possibly going to review our approach to intertype declaration
naming.  The names are currently mangled deliberately to preserve some
of the 'rules' that AspectJ defines.  For example, private field itds
have mangled names because the field is private to the aspect and
shouldn't be visible as a 'regular' private field in the target.  This
also enables two aspects to ITD the same private field and there is no
clash in the target type.

However, since those rules were defined a long time ago, things have
changed and various frameworks are looking at members via reflection,
for purposes of invocation or automatic persistence.  The mangling is
unhelpful here.

I *thinking* about allowing non-mangled names, possibly with a
directive annotation in the aspect that says "do not mangle these, I
know what I'm doing and there won't be a problem".

Basically I wanted to collect any thoughts from you guys?

I suspect that the some of the scenarios AspectJ worries about rarely
happen in practice - have you ever ITD'd the same named private field
from two aspects onto the same type?  (AspectJ can continue to
warn/error when it sees this about to happen of course)

cheers,
Andy
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top