Mixing in defaults

Michelle D'Souza michelle.dsouza at utoronto.ca
Mon May 12 15:16:33 UTC 2008


>
> Do you have any preference for which approach we use? I tend to  
> prefer any solution that has less lines of code, but there's clearly  
> an effort in initCssClassNames() to ensure a 1:1 mapping of the  
> defaults and the user-specified overrides.
>

I agree that less lines of code are always better. The actual function  
exists in Fluid.js but calling it from component code is also one line:

fluid.utils.initCssClassNames(defaults, overrides);

I agree that this is a badly named function - how about  
'fluid.utils.override'.

So, for me the question comes down to how safe we want to be. We know  
what we are willing to have overridden so using the more specific  
function seems right to me. Although I used the word 'safe' I can't  
actually come up with a reason why mixing in arbitrary properties that  
would never be called or activated is 'unsafe'. So I guess I'm willing  
to go with what ever the consensus is but I'm leaning toward the fluid  
function.

Michelle


------------------------------------------------------
Michelle D'Souza
Software Developer, Fluid Project
Adaptive Technology Resource Centre
University of Toronto