After reading Chris Matt’s comments on interfaces, I started noticing all kinds of FooImpl classes in the code over here. As far as I can tell, the only reason for using …Impl for a class name is because the Foo interface only exists to be mocked – so the implementations are FooImpl, MockFoo and any other one-off Foo implementations used in testing.
I like ‘real’ names. I’d prefer to see classes named, say, DefaultFoo or SimpleFoo or BasicFoo instead. FooImpl feels clunky, especially if it’s still there after AdvancedFoo and QuickFoo are created. Is this a good thought, or am I missing something?
These thoughts mostly prompted by reading about PicoContainer, which is cute but seems to promote the naming pattern.
Update: there are better names than DefaultFoo (thanks for anonymous advice)