Re: [Widgets] WidgetStorage interface

On Monday, November 21, 2011 at 11:19 PM, Marcos Caceres wrote:

>  
>  
> On Monday, 21 November 2011 at 21:42, Robin Berjon wrote:
>  
> > On Nov 21, 2011, at 18:08 , Marcos Caceres wrote:
> > > As part of LC, I've received quite a bit of offline feedback that because of some issue in Webkit, it's difficult for implementers to reuse the WebStorage interface in a widget context: the problem is that Widget's use of Web storage slightly modifies some of the behaviour of the storage methods (e.g., some things are read only and throw exceptions). The way around this is to define a WidgetStorage interface that allows for the specific behaviour defined in the Widget spec.  
> >  
> >  
> >  
> >  
> >  
> > I don't mind the change, but can you provide more details about why it's a problem with WebKit?
> I'm told that Web Storage in Webkit is locked up tight so you can't extend it.  
> > If it was due to problems with what was done in the spec(s), we should document those to make sure we don't make the same mistakes again.
>  
>  
>  
> Yes. Simple rule: if you change the behaviour of an interface even slightly, sub-class it.  
Let me clarify a little bit here, because it's bugging me. Usually, an object can take an interface and implement new custom behavior without any problems (interfaces generally are supposed to decuple interaction from implementation… as it's done in Java… with, say "implements Runnable"). However, in this particular instance, it seems that it's not possible to reuse an interface in this way (maybe it's some C thing, or maybe Storage is not actually defined as an interface but as an object).  

Received on Tuesday, 22 November 2011 11:35:02 UTC