Interface with inner implementation - good or bad
- by dermoritz
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)