Default methods syntax/semantics [Re: Updated State of the Lambda]
Brian Goetz
brian.goetz at oracle.com
Mon Dec 12 17:29:30 PST 2011
>> Eventually it seems likely that many cases where people would use
>> abstract classes today (those that are stateless) will morph into using
>> interfaces as a weak form of stateless traits.
>
> I'm hoping we can deprecate the pattern where you have an interface Foo
> plus an abstract class AbstractFoo that provides an implementation skeleton.
> It seems much more elegant to have an interface Foo that also provides
> the implementation skeleton, which should be possible with default methods,
> at least in many cases.
Yes, but only if there is no state in the AbstractFoo.
More information about the lambda-dev
mailing list