stephenh / gwt-mpv-apt

an annotation processor to generate GWT events and action/result DTOs
15 stars 2 forks source link

Feature request: possibility of passing annotations on to generated action/result classes #8

Open AndrewGreen opened 13 years ago

AndrewGreen commented 13 years ago

In http://turbomanage.wordpress.com/2010/07/12/caching-batching-dispatcher-for-gwt-dispatch/, Stephenh suggested the possibility of marking classes as cacheable. I'd generalize the suggestion: provide some mechanism to pass custom annotations on the spec class through to the generated action and/or result classes.

Thanks again for this, greetings.

stephenh commented 13 years ago

Configuring annotations via annotations is a slippery slope. I know of another annotation processor that has talked about doing that sort of thing and they haven't found a good solution yet (AFAIK).

I think it is simple for no-arg annotations, e.g. @GenDispatch(addAnnotations={Cacheable.NAME}) (ends up having @Cacheable in the generated action code), but when you start thinking about parameters, e.g. trying to get @Cacheable(timeToLive=5) to be in the generated action code, then it gets harder.

I think for now I'd recommend trying the baseAction approach and seeing how that works out.