Furthermore, when opening a new project you can just read through the interfaces quickly and get a good idea of what the code is doing. You can't just read thru a whole bunch of implementations and get as good of an idea.
I do acknowledge that XImpl is kinda ugly as name.
Until you cast the object...
You should use truly immutable data types unless you specifically need otherwise, most modern languages and libraries encourage you to do so.
If the implementation doesn't provide more methods than the interface (a transparent class in GoF terminology) you should not name it.
In Java, the implementation is usually created inside a static method (a static factory) of the interface as a lambda or an anonymous class.
Again, moot point if there's only one implementation.
> If the implementation doesn't provide more methods than the interface (a transparent class in GoF terminology) you should not name it.
> In Java, the implementation is usually created inside a static method (a static factory) of the interface as a lambda or an anonymous class.
And how's that not needlessly convoluted and ugly? You're illustrating guitarbill's point about applying design patterns blindly.