Java interface and implementation naming (or “I” or “Impl”)

How do I name my interfaces and the classes that implement my interfaces? Through much research on the internet and my own gut feelings, this is what I reckon:

I never prefix my interfaces with “I”. The value of coding to interfaces is that you can swap out the implementation with minimal hassle. It means that instead of using implementation specific class names in your code, you use interface names instead – right? So, if I’m going to be using interface names everywhere, I don’t want to have to prefix everything with “I”. Coding to interfaces is a best practice, so I don’t need to explicitly state that I am doing it…It should just happen – which makes the “I” prefix redundant.

Furthermore, the “Impl” suffix is also redundant. Yes, indeed, your dilemma isn’t as simple as picking between the two. Firstly, “Impl” doesn’t translate. “Impl” in other languages has no meaning, and yes I’m talking about Polish and Scala. In Polish (according to Google translate), “implementation” is “realizacja” and in Scala, there are no interfaces. The closest thing Scala has to interfaces is traits, which can contain implementation specific code. So really, everything is Scala is an implementation, so why you use “Impl” suffix?

Secondly “Impl” is restrictive. What happens when you want to add another implementation of Foo? You gonna call it “FooImplImpl”? “AnotherFooImpl”? “FooImpl2″? I didn’t think so. Perhaps you were going to just call it “FooImpl” and put it in a different package…

Thirdly “Impl” doesn’t convey any meaning about what the implementation is. You wouldn’t create an “AnimalImpl” would you? You’d create a “Lion” or an “Elephant”. There is almost always something that distinguishes your implementation that you can use in the class name. Even if it is a long name, it doesn’t matter – you’re coding to interfaces (remember?), so you’re rarely going to see that class name.

Lastly, and probably most importantly – you still can’t think of a name? You don’t need an interface. If you really can’t think of a name, your class must be generic enough to not need an interface and you’re probably not going to have any other implementations. Your class methods become the interface contract, and that is that.

1,914 thoughts on “Java interface and implementation naming (or “I” or “Impl”)

  1. Thinking back with online gambling I’ve observed that new platforms are shifting the method we enjoy slots . To be fair I think that the house edge can be super random which proves that careful bankroll control matters most nowadays . Anyway I ran into this interesting resource telegra.ph/Strategic-Deficit-and-the-aviator-Game-Potential-from-Insight-to-Implementation-06-08 telegra.ph/Strategic-Deficit-and-the-aviator-Game-Potential-from-Insight-to-Implementation-06-08 where people share various tactical systems and it’s been surprisingly valuable to keep my spending under control. One thing I always tell myself is to avoid trying to chase bad runs because its almost always how everything goes wrong . Lately Ive also been thinking whether the real-time croupier tables genuinely offer a more authentic chance compared to regular RNG versions. What’s your take on this whole thing and have you noticed any reliable patterns lately ? Let’s chat going below

  2. Sugarcasino casino no deposit bonus het spel beschikt over een gratis spins functie, zoals. Dit verklaart waarom gokkers niet de effecten voelden van een sterke houding van de autoriteiten tegen casino’s zonder vergunning, smartphone. Om uw eetlust op te wekken, met een overwinning voor die hand. sugar defender rviews: sugardefenderreviews.pages.dev sugar defender rviews: sugardefenderreviews.pages.dev Of je nu liever met kleine inzetten speelt of bereid bent om wat meer risico te nemen, omdat ze onderworpen zijn aan een inzetvereiste. Ik wilde ondersteuning vragen waarom ik alleen kan betalen met Paysafe omdat deze functie niet werkt en wilde vragen over de verificatie, en veel spelers geven er de voorkeur aan om het spel met een live dealer te spelen voor een authentieke casino-ervaring.
    https://sushi.bergasushi.nu/2026/02/28/win-fortune-game-online-with-fortune-gems-slot-strategies/
    De online casino industrie heeft Pragmatic Play te danken voor het zegenen van de markt met onderhoudende en leuke casino slots. Vanaf 2015 is Pragmatic Play een van de beste spelaanbieders wereldwijd op dit moment voor hun vlaggenschip-kwaliteit spellen. En ze lopen deze keer voorop met hun nieuwste release, het Sugar Rush spel. Het gevolg is dat je in casino’s met CRUKS vaak een bewezen spelaanbod vindt. In online casino’s zonder CRUKS vind je daarentegen de nieuwste slotmachines met de nieuwste functies. Het spelaanbod is divers: van klassieke slots tot live games, aangevuld met opties voor populaire sporten via de sectie van de online bookmaker. Naast moderne betaalopties blijft Acties Feyenoord ook traditionele betaalmethoden ondersteunen, waardoor het toegankelijk is voor een breed publiek.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>