Are there established alternatives to ISomething / ISomethingable for interfaces?

后端 未结 9 1975
囚心锁ツ
囚心锁ツ 2021-02-08 04:37

The .NET standard of prefixing an interface name with an I seems to be becoming widespread and isn\'t just limited to .NET any more. I have come across a lot of Java code that u

9条回答
  •  盖世英雄少女心
    2021-02-08 04:55

    I've always thought this naming convention is a bit of a dinosaur. Nowadays IDEs are powerful enough to tell us that something is an interface. Adding that I makes the code harder to read so if you really want to have a naming convention that separates interfaces from classes I would append Impl to the name of the implementing class.

    public class CustomerImpl implements Customer
    

提交回复
热议问题