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.

3,233 thoughts on “Java interface and implementation naming (or “I” or “Impl”)

  1. Zagraniczne kasyna z bonusem bez depozytu gdzie można kupić paysafecardbonus powitalny bez depozytunewest no deposit bonus

  2. LexxHUD — это современный HUD для CS2 созданный для тех кому нужен красивый и удобный интерфейс во время матчей стримов и турнирных трансляций. Если вы ищете худ кс 2 кс2 худ HUD для CS2 Counter-Strike 2 HUD или просто качественный CS2 HUD LexxHUD объединяет оформление матча счёт команды игроков визуальные эффекты и другие элементы в одном решении. Программа подходит для кастомных матчей шоу-матчей любительских и профессиональных трансляций. CS2 HLTV HUD LexxHUD можно использовать как CS2 broadcast HUD CS2 tournament HUD CS2 esports HUD CS2 spectator HUD CS2 observer HUD и CS2 HLTV HUD. Он рассчитан на работу в broadcast-сценариях и помогает сделать трансляцию Counter-Strike 2 более профессиональной и понятной для зрителей. Такой HUD для трансляции CS2 HUD для стрима CS2 и HUD для турнира CS2 позволяет оформить матч в едином стиле и использовать разные темы в зависимости от формата события. программа HUD CS2 Для интеграции с трансляцией LexxHUD может использоваться как CS2 overlay CS2 stream overlay CS2 broadcast overlay CS2 match overlay а также как OBS HUD CS2 и CS2 HUD для OBS. Поддержка подходов вроде HUD CS2 Browser Source CS2 GSI HUD GSI HUD CS2 и Game State Integration CS2 HUD позволяет связать интерфейс с данными матча и выводить важную информацию в реальном времени. Это удобно для организаторов турниров стримеров комментаторов и людей которые занимаются оформлением трансляций CS2. CS2 HUD Отдельное внимание в LexxHUD уделено визуальным и тактическим элементам. Система может включать CS2 tactical radar тактический радар CS2 CS2 spectator radar CS2 scoreboard HUD и другие broadcast-компоненты. Если вам нужна программа HUD CS2 программа для трансляции CS2 оверлей для CS2 табло для CS2 или полноценное оформление трансляции CS2 LexxHUD помогает собрать всё в одном интерфейсе без необходимости использовать множество отдельных решений. HUD для кс 2 Найти проект можно по запросам LexxHUD Lexx HUD Lex HUD Лекс Худ Лексхуд Лукс Худ и Lux HUD. На сайте можно узнать больше о возможностях программы посмотреть варианты оформления выбрать подходящую лицензию и скачать LexxHUD для Windows. Если вы ищете современный визуально гибкий и функциональный HUD для Counter-Strike 2 LexxHUD разработан именно как инструмент для матчей стримов OBS и полноценного CS2 broadcast-производства. CS2 match overlay https://lexxshop.online/ оверлей для CS2

  3. Наркошопы ссылки Где купить героин Где можно купить марихуану

  4. Kasyno bonus bez depozytu 2026 20 zł za darmoczy lotto to hazardjak założyć kasyno online

  5. Наркошопы телеграм Сайт купить марихуану Закладка соли

  6. п»ї50 zЕ‚ bez depozytu za rejestracjД™ total casino biuro obsЕ‚ugi klientagry kasynowe automatybudda kasyno online

  7. Трамадол купить в москве Купить марихуана гашиш бошки Купить гашиш бошки

  8. Kasyno bonus bez depozytu 2026 top 10 kasyn online21 com casino22bet promo code free spin

  9. Купить лирику в москве Масло конопли купить Где можно купить марихуану

  10. п»ї50 zЕ‚ bez depozytu za rejestracjД™ bonus bez depozytu hotslotsfree spiny bez depozytu 2026kasyno darmowe spiny na start

  11. Сайт купить марихуану Купить наркотики москва Сайт купить марихуану

  12. Najnowsze kasyna online gry online hazardowe jednorД™ki bandyta za darmolegalne automaty do gier onlinejugar blackjack online

  13. Наркошоп Трамадол купить в москве Где можно купить мефедрон

  14. Bonus Bez Depozytu Nowe Kasyna slottica jak wypłacić pieniądzenowe automaty do gierkontakt total casino

  15. Juegos de https://www.juegos-poki.mx online gratis para ninos y adultos. Juega directamente en tu navegador sin necesidad de descargas ni registro: puzles carreras disparos juegos para dos jugadores accion deportes aventuras y exitos populares. Una amplia seleccion de entretenimiento disponible para tu ordenador tableta y telefono.

  16. Ingyenes poki jatekok erhetok el online letoltes vagy telepites nelkul. Hatalmas jatekgyujtemeny egyjatekos es barati jatekokhoz: versenyek akcio kirakos jatekok platformerek sportok kalandok es tobbjatekos modok. Talald meg a tokeletes jatekot es kezdj el jatszani most.

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>