I think it is technically ok by the Liskov Principle (I researched
some more about the original intent) since the actual contract
stipulates that you check that property.

The fact that you need to care about the implementation is suboptimal
though. I typically think of LSP meaning that if I have a method on an
interface then ideally I should be able to use it.

The advent of CQRS supports this point (though not definitively).

I'm also not saying Microsoft did a piss poor job just that for my
use, avoiding the property check would have resulted in an API design
that was cleaner and simpler for my use.

Sent from my iPhone

On Mar 11, 2011, at 10:24 AM, Louis DeJardin <[email protected]> wrote:

> Actually, wouldn't streams be an example of good Liskoviness? If there
> was a readonly stream base class, and a readwrite subclass, //that//
> would violate the immutability implied by a reference to a readonly
> stream. Having canwrite==false on the other hand means you're using a
> type which may have writable implementation.
>
> --
> Louis DeJardin - sent from a mobile From: Aeden Jameson
> Sent: Friday, March 11, 2011 10:04 AM
> To: [email protected]
> Subject: Re: Your Favorite Liskov Violations Examples in .NET
> Hi Kelly,
>
>   I'm not all that familiar with the streams library.  Would you mind
> providing a specific example.
>
> On Wed, Mar 9, 2011 at 6:31 PM, Kelly Leahy <[email protected]> wrote:
>> The entire way that streams work is an lsp violation, with read/canread....
>>
>> On Mar 10, 2011 2:29 AM, "Chris Bilson" <[email protected]> wrote:
>>> Favorite? I would't say I like it, but this is the classic:
>>>
>>> ICollection<string> a = new [] { "go ahead and try to add
>>> something...after
>>> all, I implement ICollection<>" ];
>>> a.Add("ha ha!");
>>>
>>> --c
>>>
>>>
>>> On Wed, Mar 9, 2011 at 16:46, Aeden Jameson <[email protected]>
>>> wrote:
>>>
>>>> What are your favorite examples of violations of Liskov in the .NET
>>>> framework?
>>>>
>>>> --
>>>> Cheers,
>>>> Aeden
>>>>
>>>> Blog : http://aedenjameson.blogspot.com/
>>>> Linked In: http://www.linkedin.com/in/aedenjameson
>>>> Blah Blah Blah: http://www.twitter.com/daliful
>>>> Facebook : http://www.facebook.com/aeden.jameson
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google Groups
>>>> "Seattle area Alt.Net" group.
>>>> To post to this group, send email to [email protected].
>>>> To unsubscribe from this group, send email to
>>>> [email protected].
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/altnetseattle?hl=en.
>>>>
>>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Seattle area Alt.Net" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> For more options, visit this group at
>>> http://groups.google.com/group/altnetseattle?hl=en.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Seattle area Alt.Net" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/altnetseattle?hl=en.
>>
>
>
>
> --
> Cheers,
> Aeden
>
> Blog : http://aedenjameson.blogspot.com/
> Linked In: http://www.linkedin.com/in/aedenjameson
> Blah Blah Blah: http://www.twitter.com/daliful
> Facebook : http://www.facebook.com/aeden.jameson
>
> --
> You received this message because you are subscribed to the Google
> Groups "Seattle area Alt.Net" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/altnetseattle?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Seattle area Alt.Net" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/altnetseattle?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Seattle area Alt.Net" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/altnetseattle?hl=en.

Reply via email to