Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Language: support for modifiers in TypePatterns

Ron Bodkin wrote:
> >Like Ron, I find the isInterface() style easiest to read right now.
> >However, knowing that the attribute style will be coming to the pointcut
> >language very soon once J2SE 1.5 is out, and being wary of pushing too
> >many new elements into the pointcut language, I think we should take a
> >good hard look at the attribute style. If we can find a way to do this
> >that will be compatible with the use of attribute-matching pointcut
> >expressions in general then that has a strong appeal to me...
> 
> I think using an attribute style will be more incompatible, because you
> can use these pseudo-attributes to pick out types that the compiler
> doesn't control (e.g., in java..*). By contrast, AJ developers are already
> used to the notion of having primitive pointcut descriptors supplied, and
> I don't think isInterface() is hard to read.

You're correct that these attributes would be slightly different from the
"real" attributes.  The compiler and weaver would automatically interpret
every type to have the appropriate combination of these attributes on it.
This would be completely separate from code the compiler controls.  There is
a substantial difference in that these attributes are never declared by the
programmer but only inferred by the tools.

> I'm curious why you're reluctant to add more primitive PCDs.

Let me clarify this.  isInterface() is not a PCD.  It is a new special form
of TypePattern.  We currently don't have any special forms of type patterns
so this is adding a new kind of thing to the language.  That is a bigger
change than adding a new primitive PCD.  While I also find this syntax
readable, I'm troubled by the fact that it uses () where nothing will ever
be allowed to sit between those parens.  This seems like a small abuse of
the function-call syntax style.

-Jim    




Back to the top