[dojo-contributors] Should connect take string id's for nodes?

Scott J. Miles sjmiles at turboajax.com
Tue Jun 5 15:13:08 EDT 2007


IMO, the only reason to remove this kind of convenience is performance.

For code that is time-critical, I advocate strongly against anything 
like this. For example, I was hardcore about requiring availability of 
low-overhead functions in html.js because they tend to be used in UI 
scenarios where responsiveness is critical.

I'm not talking about being sloppy here, the actual performance impact 
is mostly the overhead of the function calls (by overhead, I mean the 
cost of calling *any* function).

Again, merely IMO, I think connect in particular is better with the 
value-added.

Regards,
Scott J. Miles
TurboAjax Group
http://www.turboajax.com

Adam L. Peller wrote:
> Though it may be worth making an exception for some common calls, I'd
> be concerned about consistency (and simplicity) of our APIs.  It seems
> like there are several that accept both Node and String in the html
> package... in Dijit I think we tried to remove this pattern.
> 
> -Adam
> 
> On 6/5/07, Scott J. Miles <sjmiles at turboajax.com> wrote:
>> Hi,
>>
>> I am considering altering dojo.connect so that you can pass a string
>> (id) for a node as the first argument.
>>
>> The cost would essentially be a call to dojo.isString() for every
>> connect (and a call to dojo.byId() for every connect to a node).
>>
>> I imagine this seems like an incredibly minor thing, but I try to
>> consider every cycle used in _base code.
>>
>> Regards,
>> Scott J. Miles
>> TurboAjax Group
>> http://www.turboajax.com
>> _______________________________________________
>> dojo-contributors mailing list
>> dojo-contributors at dojotoolkit.org
>> http://dojotoolkit.org/mailman/listinfo/dojo-contributors
>>
> _______________________________________________
> dojo-contributors mailing list
> dojo-contributors at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-contributors



More information about the dojo-contributors mailing list