Peter Duniho wrote:
Robin Wenger wrote:
As I noticed there are two different naming conventions for an Interface+Implementation pair:
As Pete noted, neither is really conventional.
1.) MyClass (=Interface) + MyClassImpl (=Implementation)
or
2.) IMyClass (=Interface) + MyClass (=Implementation)
The first one is (AFAIK) from Sun Who defined originally the second one?
Idiots.
What is recommended (for which scenario)?
The second one, never. The use of 'Impl' for an implementing class is
sometimes used pedagogically when the topic is interfaces and their
implementations. In production code, both of those so-called
"conventions" violate the principle of names that make sense in the
problem domain.
Peter Duniho wrote:
I don't think you'll find anyone using the word "Class" in an interface
name, nor the suffice "Impl" in the name of a class that implements an
interface.
Unless they use "Impl" in a discussion to emphasize coding principles,
but generally Pete has the right of it.