Re: Figuring out easier readonly interfaces

On Thu, Oct 17, 2013 at 12:36 PM, James Graham <james@hoppipolla.co.uk>wrote:

> On 17/10/13 19:22, Mark S. Miller wrote:
>
>  In a quick skim of these I did not find anything that contradicts the
>> view that a read-only object implies the inability to modify the
>> underlying state *via that object*. But there's a lot of text there and
>> searching for "who" didn't find anything. Where do these APIs violate
>> the LSP interpretation of read-only?
>>
>
> I don't see how changing the name can possibly change whether the LSP is
> being violated.


LSP depends on what the contract is.



> Either we think that a fully mutable object can never be a subclass of a
> readonly/view/whatever object or we don't.


Let's take a subset of that claim:

"Either we think that a fully mutable object can never be a subclass of a
whatever object or we don't."

Well, which do you think? Doesn't it depend of what "whatever" is?



> Whether one believes that seems to depend on whether you think the missing
> setters form part of the contract that must be preserved for subclasses.
>

Exactly.



-- 
    Cheers,
    --MarkM

Received on Thursday, 17 October 2013 20:38:47 UTC