W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2013

Re: Figuring out easier readonly interfaces

From: Mark S. Miller <erights@google.com>
Date: Thu, 3 Oct 2013 08:55:04 -0700
Message-ID: <CABHxS9jws7zQs4-yivjXOpnDPtAOPPsO80R3Rqr-NLA5r=YN7Q@mail.gmail.com>
To: "Robert O'Callahan" <robert@ocallahan.org>
Cc: "public-script-coord@w3.org" <public-script-coord@w3.org>
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  *
> *

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:18 UTC