[Freeipa-devel] Freeipa domain levels naming

Petr Vobornik pvoborni at redhat.com
Thu Oct 22 15:53:53 UTC 2015


On 10/22/2015 05:49 PM, Simo Sorce wrote:
> On 22/10/15 11:29, Martin Basti wrote:
>> Hello all,
>>
>> in current master branch we have mixed usage of literals 0, 1 and
>> constants MIN_DOMAIN_LEVEL, MAX_DOMAIN_LEVEL, and it is quite mess.
>>
>> I suggest to use names for domain levels:
>>
>> COMPAT_DOMAIN_LEVEL = 0
>> PROMOTION_DOMAIN_LEVEL = 1
>> UBER_NEW_FEATURE_DOMAIN_LEVEL = 2
>>
>> MIN_DOMAIN_LEVEL = COMPAT_DOMAIN_LEVEL (=0)
>> MAX_DOMAIN_LEVEL = UBER_NEW_FEATURE_DOMAIN_LEVEL (=2)
>>
>> Benefits:
>> * ability to grep it in code
>
> Call them DOMAIN_LEVEL_0 and DOMAIN_LEVEL_1

+1

>
>> * better readability in code
>
> Sure, but random names are not appropriate imo
>
>> Martin^2
>>
-- 
Petr Vobornik




More information about the Freeipa-devel mailing list