directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Knecht <fel...@apache.org>
Subject Re: Code review - constants in interface
Date Mon, 22 Nov 2010 21:15:24 GMT
On 11/22/2010 04:03 PM, Pierre-Arnaud Marcelot wrote:
> +1,
>
> This refactoring will also need to take place in Studio where we have a few interfaces
like this too (almost one per plugin).

I'll do this.

>
> Regards,
> Pierre-Arnaud
>
>
> On 22 nov. 2010, at 15:58, Stefan Seelmann wrote:
>
>> On Mon, Nov 22, 2010 at 2:50 PM, Guillaume Nodet<gnodet@gmail.com>  wrote:
>>> AFAIK, the best pattern for that is to use a final with a private
>>> constructor and declare public static final fields in it.
>>>
>>> public class Constants {
>>>         private Constants() {
>>>                 // non-instantiable class
>>>         }
>>>
>>>         public static final String TYPE = "type";
>>> }
>>
>> Sounds good. One additional improvement would be to declare the class
>> as final, just to avoid that other classes inherit from it.
>>
>> Kind Regards,
>> Stefan
>


Mime
View raw message