My question is rather simple and the title states it perfectly: How do you name your “reference” or “basic” implementations of an interface? I saw some naming conventions:
- FooBarImpl
- DefaultFooBar
- BasicFooBar
What do you use? What are the pros and cons? And where do you put those “reference” implementations? Currently i create an .impl package where the implementations go. More complex implementations which may contain multiple classes go into a .impl.complex package, where “complex” is a short name describing the implementation.
Thank you,
Malax
I wonder if your question reflects the customs of a particular language. I write in C#, and I typically don’t have “default” implementation. I have an interface, say IDistance, and each implementation has a name that describes its actual purpose / how it is specific, say, EuclidianDistance, ManhattanDistance… In my opinion, “default” is not a property of the implementation itself, but of its context: the application could have a service/method called “GetDefaultDistance”, which would be configured to return one of the distance implementations.