PROPOSAL: @OverrideAll annotation
Gabriel Belingueres
belingueres at gmail.com
Fri May 15 04:58:40 PDT 2009
Hi,
Implementing a prototype for this using annotation processing I found
that covering all cases (like inheriting from a generic class, and
implementing several generic interfaces for example) would make the
code look somewhat ugly for the reading person, so implementing this
as an annotation IS technically possible but produce somewhat
confusing code. It seems the case that having proposing this feature
using a new keyword would keep the readability of the intended
behavior.
Here is a discussion of the feature in the annotation processing forum:
http://forums.sun.com/thread.jspa?threadID=5381073&tstart=0
(I want to thank Bruce Chapman for helping me with those annotation
processing issues.)
To summarize, I never really finished the prototype to include
generics, having realized those readability issues and that there is
not much interest in this feature.
2009/5/15 Joseph D. Darcy <Joe.Darcy at sun.com>:
> Gabriel Belingueres wrote:
>>
>> Hi,
>>
>> I've written a new feature that might be comfortable to use for
>> someone. All input is welcomed.
>>
>> Regards,
>> Gabriel
>>
>> PROJECT COIN SMALL LANGUAGE CHANGE PROPOSAL FORM v1.0
>>
>> AUTHOR(S): Gabriel Belingueres
>>
>> OVERVIEW
>>
>> Add an @OverrideAll annotation to allow a class to override all
>> inherited methods with a trivial implementation. The resulting class
>> then could be used as the basis for a Null Object pattern (or even a
>> basic Mock object.)
>>
>>
>> FEATURE SUMMARY:
>>
>> The proposed @OverrideAll annotation will allow the class to override
>> all methods (from its superclasses and implemented interfaces) with a
>> trivial body, but the defined class can choose to implement specific
>> methods, replacing those that would be produced automatically by the
>> annotation.
>>
>>
>> MAJOR ADVANTAGE:
>>
>> Less coding for implementing Null Objects, or simple tests.
>>
>
> Catching up on commenting, this sounds like a fine job for an IDE and, as
> you note, this capability already exists in some IDEs.
>
> -Joe
>
>
>
More information about the coin-dev
mailing list