Multiple SAMs for same concept
lk at teamten.com
Thu Jul 15 17:29:57 PDT 2010
On Thu, Jul 15, 2010 at 5:11 PM, Collin Fagan <collin.fagan at gmail.com> wrote:
> This is true for any interface.
I disagree. An interface like Map defines the responsibilities of the
client and of the implementing class. If this is ambiguous, then it's
a bug in the interface. If these are violated by the client or
implementing class, then it's a bug there.
But in the case of autowrapping, interfaces A and B may both be
specified well, both the client and implementing classes may properly
implement the contracts, but the application code thoughtlessly hooks
up the implementation of A with a client of B. Then A returns null
(which it's allowed to do) and the client of B doesn't handle it
This isn't something that happens with interfaces as they work today.
The application programmers shouldn't be allowed to too easily and
thoughtlessly mix and match interfaces this way.
More information about the lambda-dev