Re: [Widgets] APIs and Events preference change

On Mon, Mar 16, 2009 at 7:15 PM,  <ivan.demarino@orange-ftgroup.com> wrote:
> I agree with Scott's concern.
>
> I'm not 100% up-to-speed with the latest modification to the HTML5 specs (if
> any) but I remember that this kind of "Rubyesque" way of accessing elements
> in the Storage is only present into the "attached usage examples", but there
> is none in the API described in the document.
>
> So far I would avoid to implement stuff like that: in Javascript there is
> nothing, grammatically speaking.
>
> There could be a way, manipulating the Prototype object, doing things like:
>
>     storageObject.setItem(key, value) {
>         /* STORING CODE - DEPENDENT ON THE IMPLEMENTATION */
>         this.prototype.__defineGetter__(key, function() { /* CODE TO
> RETRIEVE THA VALUE FROM THE STORAGE - DEPENDENT ON THE IMPLEMENTATION */ });
>     }
>
> But I don't see it as very efficient and clean.
> I'm more for a "Java-ish"/classic set/get solution.
>

I'm also in favor of more classical java-ish intefaces, but they don't
seem to fit current design patterns employed by JavaScript.... in
other words, even though they look nasty, they are extremely flexible
and are well suited to the way javascript is written. I guess
JavaScript won't ever be like Java (both happy and sad about that all
at once :) ) Anyway, we will see what Hixie and/or Anne say.

Kind regards,
Marcos

-- 
Marcos Caceres
http://datadriven.com.au

Received on Tuesday, 17 March 2009 11:29:59 UTC