Re: Figuring out easier readonly interfaces

On Oct 3, 2013, at 12:33 PM, Mark S. Miller wrote:

> 
> 
> 
> On Thu, Oct 3, 2013 at 11:02 AM, Allen Wirfs-Brock <allen@wirfs-brock.com> wrote:
> 
> ...
> 
> From that perspective, I would name the most general concept:
> 
> DOMRect  -- it encompass all rectangle used by the DOM
> DOMVarRec  -- it specializes DOMRect by adding the ability to vary its coordinates.
> DOMImmutableRec  It never changes
> 
> You forgot to name the readonly one -- it specializes DOMRect by guaranteeing that its instances not provide the ability to mutate the underlying DOMRect. Given the other names, DOMRectReadOnly or DOMReadOnlyRec (did you really mean to omit the "t"?) seem like fine names for the readonly subtype.

sorry, another rushed response as the plane door closed..

I intended DOMRect to be the "read only" one. It is the most general way to use a Rectangle.  You simply use it in a "read only" and generally don't mutate it (although somebody else may have the ability).

A "writable Rectangle" is a specialization of that.  So is an absolutely immutable rectangle. 

Allen

Received on Friday, 4 October 2013 03:00:51 UTC