Gmane
Favicon
From: Alex Russell <alex <at> dojotoolkit.org>
Subject: Re: overriding attribute access
Newsgroups: gmane.comp.web.dojo.devel
Date: 2008-04-08 00:29:06 GMT (34 weeks, 2 days, 2 hours and 42 minutes ago)

AFAICT, this Observable is related to:

	http://alex.dojotoolkit.org/08/jscript/lettable.html

and I share similar performance concerns.

Instead of wrapping, my thought here would be to create special- 
purpose objects which are properties of classes. For instance, you  
might have:

	myWidget.fields.isEnabled = true;

or maybe shortened to:

	myWidget.f.isEnabled = true;

And a getter/setter would be available on that property of that object  
to take an (over-rideable) default action. Such special-case objects  
would be subject to the performance concerns we're all worried about  
here, but they could be more easily constrained in use and their  
"special-purposeness" might not hurt us so much. That said, burying  
things one more level deep on a class poses its own problems.

Fundamentally, being able to say something like:

	myWidget.f.label = "some text";

and have it instantly set the innerHTML of the widget's labelNode  
property would be a HUGE win for widget authors.

I think we should do some profiling here before shooting down the  
VBScript proxy idea entirely. If it does pan out for constrained use- 
cases, we can certainly consider moving dojo.data item value lookup  
and setting out to these Observeable/Lettable frankensteins.

Regards

On Apr 7, 2008, at 7:36 AM, Jared Jurkiewicz wrote:

> I second Trenka's comment about performance implications.  Creating
> wrapper objects in IE seems very scary/performance inhibiting.  Isn't
> this effectively the same thing as the 'lettable' idea Alex was
> talking about some few weeks back?
>
> -- Jared
>
>
> On Mon, Apr 7, 2008 at 10:32 AM, Bill Keese <bill <at> dojotoolkit.org>  
> wrote:
>> Kris Zyp wrote:
>>> Observable creates a new object (a
>>> vbscript) that "wraps" the original.
>>
>> Uh oh, so that means we would need to resurrect the createWidget()
>> factory method?
>>
>>
>> _______________________________________________
>> 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

--
Alex Russell
alex <at> sitepen.com  A99F 8785 F491 D5FD 04D7 ACD9 4158 FFDF 2894 6876
alex <at> dojotoolkit.org BE03 E88D EABB 2116 CC49 8259 CF78 E242 59C3 9723