RFR: 8004518 & 8010122 : Default methods on Map

Ulf Zibis Ulf.Zibis at CoSoCo.de
Wed Apr 10 08:47:25 UTC 2013


Hi all,

when I see all the extensions on interfaces via the new default construct, I still have the feeling, 
such entities should be seen and named as "normal" abstract classes. This would additionally allow 
protected and private members, which otherwise can be a cumbersome restriction.
To be compatible to legacy code, IMO it would be enough to extend the usage of keyword "implements" 
for abstract classes. I'm aware, that there should be some restrictions on such abstract classes to 
be manageable as interfaces, but not as strict as for current interface default method approach.

In fact, the interface default methods is the introduction of multi-inheritance in Java throug the 
backdoor, so why not give it a prominent full featured place and handle and name it as such?

Is there anybody willing to discuss the reasonable for the "lousy" makeshift as I see the default 
method construct:
- verbose ugly syntax
- cumbersome restrictions
- unnecessary complicated priority rules:
- - some of the priority collisions could be handled by simply
     distinguishing between e.g. "implements Map" and "extends Map"

 From the call site view, I'm not aware, if it would make any difference, having e.g. j.u.Map as 
interface or abstract class:
     Map myMap = new HashMap();
     myMap.doSomething();


Regards,

-Ulf




More information about the core-libs-dev mailing list