Azure Page Blobs vs. Liskov Substitution Principle

Posted on February 19th, by Arnon Rotem-Gal-Oz in Blog. 2 comments

“Liskov Substitution Principle” or LSP is one of the basic principles for proper object orientation. LSP definition is:

Let q(x) be a property provable about objects x of type T. Then q(y) should be true for objects y of type S where S is a subtype of T.”

In plain english that means that if CloudPageBlob inherits from CloudBlob and CloudBlob.UpdateText(someText) works CloudPageBlob.UpdateText(someText) should also work and not throw and exception… (or alternatively CloudPageBlob shouldn’t inherit from CloudBlob)

Hear that Microsoft?

Illustration by Benjipie

Tweet about this on Twitter2Share on LinkedIn0Share on Facebook0Share on Google+0Buffer this pageShare on Reddit0Share on StumbleUpon0Email this to someone