W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: [Widgets] WidgetStorage interface

From: Marcos Caceres <w3c@marcosc.com>
Date: Tue, 22 Nov 2011 13:59:22 +0100
To: João Eiras <joaoe@opera.com>
Cc: public-webapps <public-webapps@w3.org>
Message-ID: <80A692633C8C4BE9A31F3FB60C38A217@marcosc.com>


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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:48 GMT