directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trustin Lee <trus...@gmail.com>
Subject Re: Interface/Class naming inconsistencies
Date Thu, 13 Oct 2005 08:39:17 GMT
2005/10/13, Ersin Er <ersin.er@gmail.com>:
>
> It seems that we do not have a consistent naming convention for
> interfaces and their implementor classes. For example, when the
> interface is named Foo, we may have implementor classes named like
> FooImpl, BaseFoo, DefaultFoo, etc.
>
> Which one do you think is correct (or makes sense the most)?


There are a few names I like: AbstractFoo, BaseFoo, or ConcreteNameFoo

* AbstractFoo - it is an abstract class which provides some common
implementation.
* BaseFoo - it is similar to AbstractFoo but it is not abstract at all, but
expecting somebody to extend it.
* ConcreteNamefoo (e.g. ArrayList implements List) - it is always a good
idea to give it the most concrete name.

I don't like DefaultFoo much because 'Default' sounds a little bit weird. I
use Default when I cannot find any good concrete name. I prefer DefaultFoo
to FooImpl on the other hand because 'Impl' makes me feel that I'm dealing
with low-level stuff. (This is just a personal feeling! ;)

Cheers,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/

Mime
View raw message