[Freeipa-devel] [PATCH] 031 Remove WebUI identifiers from global namespace

Adam Young ayoung at redhat.com
Wed Feb 16 15:46:28 UTC 2011


On 02/16/2011 10:16 AM, Martin Kosek wrote:
> On Tue, 2011-02-15 at 13:26 -0500, Adam Young wrote:
>> On 02/15/2011 08:25 AM, Martin Kosek wrote:
>>> Many WebUI identifiers were defined in a global namespace. This is
>>> not a good programming practice and may result in name clashes,
>>> for example with other libraries.
>>>
>>> This patch moves these variables to IPA namespace or its
>>> sub-namespaces, if required.
>>>
>>> https://fedorahosted.org/freeipa/ticket/212
>>>
>>>
>>> _______________________________________________
>>> Freeipa-devel mailing list
>>> Freeipa-devel at redhat.com
>>> https://www.redhat.com/mailman/listinfo/freeipa-devel
>>
>>
>> Martin,  he is the patch I did for the cert portion.  I'll toss it,
>> but you can see what I was thinking as far as hoe to shorten the
>> names:
>>
>> BTW, you should reverse the names of your patch so that they start
>> with freeipa, and then your user id.
> Adam, thanks for all the remarks. Here is a second version of the patch
> based on your work on certificate module. I tried to keep the patch
> simple without too much changes.
>
> There are 3 new subnamespaces in this patch - sudo, cert and nav. I have
> removed a lot of unused code in search.js, you may want to check it
> closer. This enabled me to move search_generate_checkbox_td
> functionality just to a place where its needed.

Almost there.

I'd like to pull the sudo namespace out of ipa.js and put it into 
sudorule.js, then indicate  that the other sudo files depend on sudo rule.


I guess I should have been clearer:  stuff like facets and widgets don't 
need to go into a sub, namespace, just custom code called by them.  I'm 
thinking that widgets and facets in the long term should become a 
sub-namespace of IPA themselseves:  so IPA.widget.text, 
IPA.facet.details, and then the more specific ones.  While I don't want 
to do that in this patch, keep that in mind when deciding which 
namespace to put something into.  A good rul of thumb is that an entity 
name should not be repeated in a function name, so something like 
IPA.sudo.sudorule_details_facet should be IPA.sudorule_details_facet  
but any custom functions it calls should be in IPA.sudo.


I'm being a bit picky here as this is probably the last major cleanup 
we'll get to do before GA, and this is the code that people will look 
at.  I want it to be as understandable as possible.



> Martin
>
>
>
> _______________________________________________
> Freeipa-devel mailing list
> Freeipa-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/freeipa-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20110216/d2da9cdb/attachment.htm>


More information about the Freeipa-devel mailing list