Default method survey results
Collin Fagan
collin.fagan at gmail.com
Mon Aug 13 07:25:29 PDT 2012
As much as developers would like them to be, and as much as modern
frameworks treat them as such, annotations are not keywords. Annotations
were intended only to add information and not to actually change the
meaning of anything in the language. Frameworks can blur the lines if they
wish but I think the Java language itself should not break it's own rules
for this one case.
Collin
On Mon, Aug 13, 2012 at 9:09 AM, Jose A. Illescas <jantonio.illescas at rbc.com
> wrote:
> Gregg,
>
> Compiler can add "default" keyword for every method (on interface)
> with implementation (delimiteded with "{...}" instead of "default")
>
> Demarcations on developer hands are ugly, (I think) must be resolved
> by compiler...
>
>
> On 13/08/2012 15:52, Gregg Wonderly wrote:
> > In this day and age of the Java language, reusing existing keywords,
> > trying to shoehorn them into use for a new purpose, can feel a little
> > clumsy. Annotations can provide a much better mechanism in many
> > cases, simply because the right nomenclature is helpful.
> >
> > However, annotations also have a very specific usage scenario with
> > tooling and moment-of-use issues. For me, this means that you can't
> > use annotations in places that annotations wouldn't work with the
> > normal annotation tooling. You certainly don't want to have to have a
> > special class of annotation that further confuses the use of
> > annotations in other cases.
> >
> > The use of "default" isn't awesome, but it does provide a usable
> > demarcation which the compiler and run-time class loading can use to
> > make the right decision for how to build the v-tables to dispatch the
> > default method should it be involved some how.
> >
> > Gregg Wonderly
> >
> > On 8/13/2012 8:35 AM, Jose A. Illescas wrote:
> >> On 13/08/2012 15:23, Deepak S Patwardhan wrote:
> >>>> -----Original Message-----
> >>>> From: lambda-dev-bounces at openjdk.java.net [mailto:lambda-dev-
> >>>> bounces at openjdk.java.net] On Behalf Of Jose A. Illescas
> >>>> Sent: 13 August 2012 16:40
> >>>> To: Brian Goetz
> >>>> Cc: lambda-dev at openjdk.java.net
> >>>> Subject: Re: Default method survey results
> >>>>
> >>>> Brian, Why not add one thirth option (without "default" keyword) to
> >>>> poll?
> >>>>
> >>>> 1. void foo() default {
> >>>> System.out.println("foo");
> >>>> }
> >>>>
> >>>> 2. default void foo() {
> >>>> System.out.println("foo");
> >>>> }
> >>>>
> >>>> 3. void foo() {
> >>>>
> >>>> System.out.println("foo");
> >>>> }
> >>>>
> >>> If we explore going down this path, I think we should also explore
> >>> using an
> >>> annotation,
> >>>
> >>> @java.lang.Default
> >>> void foo() {
> >>> System.out.println("foo");
> >>> }
> >>>
> >> Deepak, why proposed annotation?
> >>
> >> I would like see an implementation as any other java method
> >> (without new keywords, annotations, ...)
> >>
> >> Implements a interface method ("default") must be equals to
> >> implement another class method (I want "complexity" out of developer
> >> hands, into compiler...)
> >>
> >>
> >>
> >>> I would be interested in knowing if using such an annotation has any
> >>> demerits.
> >>>
> >>> Regards,
> >>> Deepak S Patwardhan.
> >>>
> >>>>
> >>>> On 12/08/2012 00:30, Brian Goetz wrote:
> >>>>> Poll is closed, and results can be seen here:
> >>>>>
> >>>>>
> >>>>>
> >>>> https://www.surveymonkey.com/sr.aspx?sm=xPw4AxfWK2TTQLQtbIpQCg0l
> >>>> bkw_2fuYDiZnrBDB_2bPyd4_3d
> >>>>>
> >>>
> >>
> >>
> >
> >
>
>
>
More information about the lambda-dev
mailing list