commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r1528612 - /commons/sandbox/monitoring/trunk/reporting/src/main/java/org/apache/commons/monitoring/reporting/web/plugin/PluginRepository.java
Date Sat, 05 Oct 2013 11:43:28 GMT
On 5 October 2013 10:51, Romain Manni-Bucau <rmannibucau@gmail.com> wrote:
> Activated cause it answer the question (if) "is activated"

But why not ".active" or ".isActive"?

There must be some other bit of code that sets the property initially.

It may just be a convention that the user has to set the property.

Whatever the reason for choosing this particular string, it needs to
be documented at the point of use (possibly via a link to existing
docs).

> Le 5 oct. 2013 00:46, "sebb" <sebbaz@gmail.com> a écrit :
>
>> On 4 October 2013 23:23, James Carman <james@carmanconsulting.com> wrote:
>> > On Fri, Oct 4, 2013 at 6:11 PM, sebb <sebbaz@gmail.com> wrote:
>> >>
>> >> Back to the case in point: why is the string ".activate" and not
>> anything else?
>> >>
>> >
>> > Why not just extract a constant and name it something logical like
>> > "ACTIVATED_INDICATOR"?  Then, the actual value of the constant can be
>> > whatever you want.  The value of the string isn't important (other
>> > than making it a bit more human-readable of course).  What is
>> > important is that you use the string in a consistent fashion
>> > throughout your code.  By not using a constant, it makes it more
>> > likely to fat-finger the value when you type it again somewhere.
>> > Anyway, I'm sure I'm not telling you anything new.  I just don't think
>> > it's relevant to go into a lengthy discussion about the string that's
>> > used as some sort of marker.  Just extract the constant (and use it)
>> > and move on.
>>
>> That was exactly my point.
>> However, I don't think the value is arbitrary, given that it is only used
>> once.
>> It looks to me as though the code is relying on some external
>> convention for property naming.
>>
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> > For additional commands, e-mail: dev-help@commons.apache.org
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message