[infinispan-dev] boolean properties in config
Galder Zamarreño
galder at redhat.com
Tue Dec 13 03:44:37 EST 2011
On Dec 12, 2011, at 3:45 AM, Mircea Markus wrote:
>
> On 10 Dec 2011, at 10:04, Pete Muir wrote:
>
>> https://issues.jboss.org/browse/ISPN-1474
>>
>> Currently we do a mix of:
>>
>> enableXXX()
>> disableXXX()
>> enabled(boolean b)
>> XXX(boolean b)
>>
>> where XXX is something to enable or disable (e.g. purgeOnStartup). We also the scatter the word use around in a very inconsistent fashion.
> this is a bit ugly indeed
+1
>>
>> I would like to rationalise this, and would propose that every boolean has:
>>
>> enableXXX
>> disableXXX
>> xxxEnabled(boolean b)
>>
>> The former 2 are nice for hardcoded config, the latter is nice when you are adapting one format to another (e.g. Paul).
> I think this would be much more readable. My only comment is that we allow two ways of doing the same thing, which might be slightly confusing for the users. Also the easiness of migration from old to new configuration is important, but IMO not as important to make the new config simple.
I agree with Mircea that having two ways of doing the same thing might confuse users. If I had to choose I'd probably go for the latter option.
>>
>> I would deprecate the usage of XXX(boolean b) and useXXX(boolean b) and remove in 6.
>>
>> Thoughts?
>> _______________________________________________
>> infinispan-dev mailing list
>> infinispan-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
>
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache
More information about the infinispan-dev
mailing list