Re: [Widgets] WidgetStorage interface

On Tuesday, November 22, 2011 at 1:40 PM, João Eiras wrote:

>  
> > > 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).
>  
>  
>  
> Or then it's an implementation problem, and there is little point changing  
> the specification ?

I write specs so they get implemented. Don't really care about academic purity of what an interface is.   

Having said that, Opera implemented this correctly.  

> I don't see how a new interface object would make programming its behavior  
> more easy.

Because it's reflected as a new class. In Webkit, it seems, you can't have two objects that implement Storage, but behave slightly differently. So, having WidgetStorage frees Webkit implementers to have all the goodness of WebStorage, but an object that stringyfies to [object WidgetStorage]… stupid, I know… but c'est la vie.    

--  
Marcos Caceres

Received on Tuesday, 22 November 2011 12:59:58 UTC