Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] ITD for type patterns, not just exact types

I think there may be issues open for ITD on type patterns, I had a very quick look but couldn’t find them but it has been talked about before certainly.

I am wary of anything that makes ITDs more complicated as there are a few ‘hacks’ in JDT already to support them and I don’t really want to add any more. I even had a vague thought (don’t panic) about removing code style syntax and just using annotation style syntax (provided we had some form of feature parity - annotation style syntax isn’t complete enough yet for this). I’ve been thinking about it for a while but the new speed with which Java is moving is making the patching job something that has to be done more frequently, and it isn’t fun. This would leave all development time simply to improve the weaving and fix bugs there.

> But at least the type pattern syntax per se and the corresponding matching rules already exist for normal (non-ITD) pointcuts, so maybe just the parser needs to be extended and of course ITD generation itself (the process of actually adding the same members, methods or constructors to a set of target classes instead of a to single one) as well.

I’m really not sure what needs doing without digging into it, and I can’t honestly say when I’ll find time for that. But I recognize the power of the feature. How far can you get with a pattern on DeclareMixin?

Cheers,
Andy

> On Jan 19, 2019, at 7:42 PM, Alexander Kriegisch <alexander@xxxxxxxxxxxxxx> wrote:
> 
> Hi Andy.
> 
> Do you think there is a chance to implement a feature request about enabling ITD for groups of classes instead of having to know exact class names beforehand? A typical example is that people on StackOverflow often ask about declaring static loggers via ITD. If this could be done in a more generic way by utilising type name patterns instead of fixed type names, I think it would be a huge and useful improvement. The only workaround thus far is to use annotation processing, but then you also need to know beforehand which classes to target because you need to annotate them. I personally try to avoid marker annotations because I usually want to keep my core code as clean as possible from AOP-related stuff, keeping the aspects really separate as cross-cutting concerns.
> 
> I would be interested in your feedback before I just create a Bugzilla ticket out of the blue, maybe without any chance for it to ever get implemented because it would be too much effort to implement it in the first place. I am aware of the fact the the AspectT syntax would need to be somewhat expanded for this. But at least the type pattern syntax per se and the corresponding matching rules already exist for normal (non-ITD) pointcuts, so maybe just the parser needs to be extended and of course ITD generation itself (the process of actually adding the same members, methods or constructors to a set of target classes instead of a to single one) as well.
> 
> Kind regards
> -- 
> Alexander Kriegisch
> https://scrum-master.de
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/aspectj-users



Back to the top