Community
Participate
Working Groups
A well-known AspectJ idiom calls for creating an intermediate type (usually an interface), using declare parents to make it a super type of a set of type, and introducing members to it. aspect EntityManagement { private static interface IEntity { } declare parents: com.myco.domain.* implements IEntity; private long IEntity.lastAccessedTime; ... advice to IEntity+ ... } This idiom may be simplified if the declare parents declaration were to allow something like: declare parents: <TypePattern> <implements|extends]> <Type> [{ [TypeBody] } ]; This declaration defines the parent type and makes it a super type for the matching types in one statement. Then the aspect will simplify to the following: aspect EntityManagement { declare parents: com.myco.domain.* implements IEntity { }; private long IEntity.lastAccessedTime; ... advice to IEntity+ ... } This feature also offers a simpler way to implement the "typedef" feature and may help in reducing the number of parentheses when creating annotation-based pointcuts.