Interface with inner implementation - good or bad

Posted by dermoritz on Stack Overflow See other posts from Stack Overflow or by dermoritz
Published on 2012-06-04T16:01:46Z Indexed on 2012/06/05 10:40 UTC
Read the original article Hit count: 184

Filed under:
|
|

I am working on a project with many someInterface - someInterfaceImpl-pairs. Some days ago I got the idea (probably inspired by reading some objective c code) to include the default implementations as an inner class. Now some colleagues (all with much more java experience than me) saw this idea - feedback was between shocked and surprised ("this is working?").

I googled around a bit but didn't find much evidence of usefulness of this "pattern" (personal i like it): pdf-paper and a faq about code style

What do you think - especially in those cases where an "default" implementation is tightly coupled to an interface.

Update i just found this: Java Interface-Implementation Pair

(see accepted answer)

© Stack Overflow or respective owner

Related posts about java

Related posts about interface