Using “Base” in a Class Name

前端 未结 13 2073
旧巷少年郎
旧巷少年郎 2020-12-30 21:07

Is it acceptable to use the word \'Base\' in a class name which is a the bottom of the inheritance tree?

I have always found this a bit of a cop-out, just wondering

13条回答
  •  独厮守ぢ
    2020-12-30 21:31

    In Java I tend to provide a base implementation of an interface Foo in an abstract class FooBase. I think that is perfectly ok, and makes the connection to the interface very clear and regular.

    Without the interface I would call the abstract base class Foo.

提交回复
热议问题