Re: Figuring out easier readonly interfaces

If that's what you mean, then it definitely needs a better name. If roFoo
is an instance of a ReadOnlyFoo or a FooReadOnly, then if you give me that
instance, you should know that you've given me only the ability to observe
mutations, but not the ability to cause them. If we don't need FooReadOnly
or FooImmutable now, let's postpone them. But let's not use up these names
to describe instances that don't provide these guarantees.



On Thu, Oct 3, 2013 at 7:00 AM, Robert O'Callahan <robert@ocallahan.org>wrote:

> On Thu, Oct 3, 2013 at 9:56 AM, Mark S. Miller <erights@google.com> wrote:
>
>> But a DOMRect is mutable by script, and so is not an LSP subtype of
>> DOMRectReadOnly.
>>
>
> Is too!
>
>
> -- DOMRectReadOnly: an interface exposing read-only accessors to the
>> current state of a DOMRect. Nothing is said about whether the object is
>> mutable or not.
>>
>
> "ReadOnly" only means you can't modify the object through the methods of
> that interface. It says nothing about the mutability or otherwise of the
> object. A DOMRect satisfies all the invariants of a DOMRectReadOnly and is
> therefore LSP substitutable.
>
> Perhaps this base type need a better name. Suggestions welcome.
>
> Rob
> --
> Jtehsauts  tshaei dS,o n" Wohfy  Mdaon  yhoaus  eanuttehrotraiitny  eovni
> le atrhtohu gthot sf oirng iyvoeu rs ihnesa.r"t sS?o  Whhei csha iids  teoa
> stiheer :p atroa lsyazye,d  'mYaonu,r  "sGients  uapr,e  tfaokreg iyvoeunr,
> 'm aotr  atnod  sgaoy ,h o'mGee.t"  uTph eann dt hwea lmka'n?  gBoutt  uIp
> waanndt  wyeonut  thoo mken.o w  *
> *
>



-- 
    Cheers,
    --MarkM

Received on Thursday, 3 October 2013 15:55:36 UTC