Default methods syntax/semantics [Re: Updated State of the Lambda]

Per Bothner per at bothner.com
Mon Dec 12 16:30:18 PST 2011


On 12/12/2011 03:48 PM, Brian Goetz wrote:
> 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.

If that becomes common, we can certainly expect all kinds of
pressure to add more features to interfaces!
-- 
	--Per Bothner
per at bothner.com   http://per.bothner.com/


More information about the lambda-dev mailing list