Factbites
 Where results make sense
About us   |   Why use us?   |   Reviews   |   PR   |   Contact us  

Topic: Liskov substitution principle


In the News (Sat 25 May 13)

  
  What does Barbara Liskov have to say about Equality in Java?
captures physical equality, which ignores the Liskov Substitution Principle, one of the fundamental principles in OO design.
The whole LSP thing in Java is interesting.
That is: According to the LSP, if C2 is a subclass of C1 and D2 is a subclass of D1, and there's a method in D1 that returns an object of class C2, then a method with the same name in D2 can return an object of class C1.
weblog.raganwald.com /2007/04/what-does-barbara-liskov-have-to-say.html   (3919 words)

  
  Liskov substitution principle - Wikipedia, the free encyclopedia
Thus, Liskov and Wing's notion of "subtype" is based on the notion of substitutability; that is, if S is a subtype of T, then objects of type T in a program may be replaced with objects of type S without altering any of the desirable properties of that program (e.g., correctness).
In addition, the principle implies that no new exceptions should be thrown by methods of the subclass, except where those exceptions are themselves subtypes of exceptions thrown by the methods of the superclass.
Such a function violates the open/closed principle because it must be modified whenever a new derivative of the base class is created.
en.wikipedia.org /wiki/Liskov_substitution_principle   (296 words)

  
 DDJ | Departments | Architecture & Design | Architecture Blog
LSP was defined back in 1988 by Dr. Barbara Liskov.
The classic examples for violation of this principle are an ellipse that inherit a circle or a square that inherits a rectangle (hint: the rectangle has a setWidth and SetHight methods).
LSP is the reason that it is hard to design and create good deep hierarchies of sub classes and the reason to consider using composition over inheritance.
www.ddj.com /blog/architectblog/archives/2006/08/liskov_substitu.html   (717 words)

  
 Chapter Seven: Type Hierarchy
Liskov asserts that a compiler may not be able to determine what code to run when a method is called.
The Liskov substitution principle ensures that an inheritence hierarchy is correct.
In the Liskov substitution principle (simply "the substitution principle" in the text), an object created by a subclass must behave the same as an object created by a supertype.
cs.allegheny.edu /wiki/cs290F2004/121   (478 words)

  
 Liskov substitution principle - Cleverpedia, the ultimate encyclopedia   (Site not responding. Last check: )
The liskovsche substitution principle is a criterion in object-oriented programming, which indicates, when a data type is to be modelled as subclass of another type.
The liskovsche substitution principle became 1993 of Barbara Liskov and Jean-nice Wing in the article Family VALUEs: A Behavioral Notion OF Subtyping formulates.
In the available case it was stated that the statement “the axles know independently are scaled” to the class ellipse, however not to the class circle apply.
cleverpedia.com /Liskov_substitution_principle   (525 words)

  
 JayFlowers > Liskov Substitution Principle and Testability
When you have an inheritance hierarchy that follows LSP the testing effort for the entire hierarchy can be less than the effort to test the same number of classes not in an inheritance hierarchy.
Meaning that as soon as a subtype is introduced into the hierarchy that behaves differently than the supertype the benefit to the new subtype is lost and we are in a situation where inheritance is not offering any reuse to increase testability.
On c2.com’s LSP page the distinction between subtyping and subclassing is discussed in detail.
jayflowers.com /WordPress/?p=79   (1180 words)

  
 Liskov Substitution Principle on iface thoughts
The Open-Closed Principle is the heart of OO design.
LSP tries to address the behavioral notion of subtyping.
I believe it should be “… the behavior of P is unchanged when o2 is substituted by o1 then S is a subtype of T”.
ifacethoughts.net /2006/03/23/liskov-substitution-principle   (965 words)

  
 Principles Of OOD by Robert Martin - Java edition
And the principle we are discussing is the principle of "Common Closure within Categories." This principle is the first and most important of the three rules for category cohesion.
The principle of common closure states that, given a particular kind of change, either all of the classes within a category are closed to it, or they are all open to it.
Principle 9 says that categories that are placed into positions of stability ought to be abstract.
www.tek271.com /articles/pood/PrinciplesOfOOD.java.html   (4219 words)

  
 Liskov Substitution Principle
LSP is claimed by some to be one of the PrinciplesOfObjectOrientedDesign.
I tend to think that LSP is actually a special case of a more general principle of engineering: "you can't do with less than what you need." If you are going to substitute this bit in for another bit, it had better satisfy all contextual expectations.
Substitutability is demonstrably not a binary relation, it is a ternary relation.
c2.com /cgi/wiki?LiskovSubstitutionPrinciple   (13905 words)

  
 [No title]   (Site not responding. Last check: )
(The Liskov Substitution Principle) -------------------------------------------------------------------- This rule is a logical extension of the open/closed principle.
In fact, any subtype of T should be substitutable as an argument of F. If this were not true, then F would have to have tests to determine which of the various subtypes it was using.
And this breaks the open/closed principle For example: Consider the problem of the Square and the Rectangle.
cpptips.hyperformix.com /cpptips/principles2.txt   (270 words)

  
 Learn more about Liskov substitution principle in the online encyclopedia.   (Site not responding. Last check: )
Learn more about Liskov substitution principle in the online encyclopedia.
The Liskov substitution principle is one and considered only one definition of subtype, a kind of datatype.
The name commonly used in the field of object-oriented computer programming for the definition of subtype introduced by Barbara Liskov and Jeannette Wing in a 1993 paper entitled Family Values: A Behavioral Notion of Subtyping.
www.onlineencyclopedia.org /l/li/liskov_substitution_principle.html   (162 words)

  
 (ootips) What Makes A Good Object-Oriented Design?
The Liskov Substitution Principle: Derived classes must be usable through the base class interface without the need for the user to know the difference.
The Reuse/Release Equivalency Principle: The granule of reuse is the same as the granule of release.
The Acyclic Dependencies Principle: The dependency structure for released components must be a directed acyclic graph.
www.ootips.org /ood-principles.html   (478 words)

  
 DoodleProject - The Open-Closed Principle
The major benefits received from the open-closed principle are modules that are open for extension, yet closed for modification.
As stated, the open-closed principle is the cornerstone of object-oriented design and probably the most important convention in the practice of object-oriented design.
Another very important principle that governs the creation of inheritance hierarchies is the Liskov Substitution Principle, which will be explained next time.
doodleproject.sourceforge.net /articles/2000/openClosedPrinciple.html   (749 words)

  
 The Liskov Substitution Principle
The above is a paraphrase of the Liskov Substitution Principle (LSP).
In order for the LSP to hold, and with it the Open-Closed principle, all derivatives must conform to the behavior that clients expect of the base classes that they use.
It is only when derived types are completely substitutable for their base types that functions which use those base types can be reused with impunity, and the derived types can be changed with impunity.
homepage.ntlworld.com /hchalkley/STANDARD/lsp.htm   (2580 words)

  
 (ootips) What Makes A Good Object-Oriented Design?
The Liskov Substitution Principle: Derived classes must be usable through the base class interface without the need for the user to know the difference.
The Reuse/Release Equivalency Principle: The granule of reuse is the same as the granule of release.
The Acyclic Dependencies Principle: The dependency structure for released components must be a directed acyclic graph.
ootips.org /ood-principles.html   (478 words)

  
 The Liskov Substitution Principle (LSP)   (Site not responding. Last check: )
Programmers need to insure the substitution doesn't inject any logical errors into the program.
But if the received state doesn't happen to be a special state, then this breaks the class invariant for the special cell.
We might try to get a little more out of LSP by saying subtypes are substitutable for supertypes not just in programming contexts but also contexts such as correctness proofs and programmer's minds.
www.mathcs.sjsu.edu /faculty/pearce/cs251b/principles/liskov2.htm   (1051 words)

  
 Liskov Substitution Principle :: DenkzeitWiki
That is, subclassing is a software construction principle, used to create a new class which has similar behavior to another class, while a subtype is a class which can be substituted for another class and still be guaranteed to behave properly, albeit differently.
LSP as stated above seems to be about replacing one concrete type with another, and the conditions under which a concrete subtype can be used in every context that another type was used.
LSP is tight, and it points towards things like flbox reuse.
www.gungfu.de /facts/wiki/Main/LiskovSubstitutionPrinciple   (150 words)

  
 Justin Carulli, Lab 2
Hierarchies that follow the Liskov Substitution Principle have classes that are parent classes to lower classes, though the parent classes do not know it.
The hierarchy created in this laboratory does, in fact, conform to the Liskov Substitution Principle because none of the code was changed from class BankAccount to develop classes CheckingAccount and SavingsAccount.
These lower classes were able to manipulate the characteristics from the upper class without the upper class knowing or adapting, so therefore this hierarchy is valid in terms of the Liskov Substitution Principle.
cs.allegheny.edu /wiki/cs102S2004/64   (310 words)

  
 ghytred.com - Articles
It may be appropriate to change the constructor of the concrete classes to internal so that they can only be created by the factory class and not directly by the clients (this is great help when converting to an abstract interface from a single concrete class: the compiler will show you where it is used!).
He originally came up with it in the context of large C++ projects which have their own specific problems due to the structure of the language; these problems do not apply so much to C# but the principle is still valid.
Its essence is the 'principle of least knowledge' regarding the object instances used within a method.
www.ghytred.com /ShowArticle.aspx?DesignPrinciples1   (2054 words)

  
 Reza's Weblog : Weblog   (Site not responding. Last check: )
Subclasses should be substitutable for their base classes.
Restating the LSP (Liskov Substitution Principle) once again, this time in terms of the contracts, a derived class is substitutable for its base class if:
Usually violations of LSP are latent violations of OCP (Open-Closed Principle).
jroller.com /page/rezaghp?entry=the_liskov_substitution_principle   (189 words)

  
 cs205: Problem Set 4 - Comments
That would violate the substitution principle, but it is okay according the the Eiffel rules.
To follow the substitution principle, it should be the case that all subtypes of
The signature rule is guaranteed by the Java compiler (it enforces the no-variant rule on the parameter and return types of the overriding methods, and because of inheritance we know the subtypes provide all of the supertype methods).
www.cs.virginia.edu /~evans/cs205/ps/ps4/comments.html   (1650 words)

  
 David Hayden [MVP C#] : The Liskov Substitution Principle - Agile Software Development Principles Patterns and Practices
The classic example of this principle in code is inheriting the Square Class from the Rectangle Class.
It could turn out that when subclasses are substituted for a base class, you may get unexpected results.
If you want to read some discussions as to the usefulness of this principle, whether it should be a principle, and thoughts on the classic example above, check out this wiki.
codebetter.com /blogs/david.hayden/archive/2005/06/11/64477.aspx   (410 words)

  
 Liskov Substitution Principle of Object Oriented Design
It should be possible to substitute an object of one type with another within the same class hierarchy.
If the original code was being used to set the temperature to any thing other than the reference temperature, it will not have the desired effect with Brand C. This method has been overriden for Brand C to perform no action.
If Liskov Substitution Principle is followed, code using a base class pointer will never break after another class is added to the inheritance tree.
www.eventhelix.com /RealtimeMantra/Object_Oriented/liskov_substitution_principle.htm   (658 words)

  
 Object Oriented Design and Programming - Software Design Principles and Design Patterns - Home
If certain principles are not applied the final framework will end in a total mess where each object relies on many other objects in order to run.
In order to avoid tight coupled frameworks, we need this mechanism to facilitate the interaction between objects in a manner in that objects are not aware of the existence of other objects.
If we take a look at the dictionary definition of a template we can see that a template is a preset format, used as a starting point for a particular application so that the format does not have to be recreated each time it is used.
www.oodesign.com   (350 words)

  
 Amazon.com: "Liskov Substitution Principle": Key Phrase page   (Site not responding. Last check: )
They are entitled: The Liskov Substitution Principle The Dependency Inversion Principle The Interface Segregation Principle Granularity Stability Whereas the techniques of refactoring tell...
Perhaps the most important is the Liskov Substitution Principle (LSP) applied to state hierarchy.
Adhere to the Liskov Substitution Principle (LSP) In one of object-oriented programming 's seminal papers,...
www.amazon.com /phrase/Liskov-Substitution-Principle   (557 words)

  
 Liskov Substitution Principle (was: Pathname)
The Liskov requirements (from my memory) are that IF the arguments and stat= e=20 for the execution of a method are valid (preconditions), THEN the message= =20 should have the expected effects and return values (postconditions).
The above three cases are the three ways that= =20 semantics can be extended without violating expectations.
So, in short, Liskov's substitution principle can be written: (SubPre -> SubPost) -> (SuperPre -> SuperPost) again as a logical implication.
blade.nagaokaut.ac.jp /cgi-bin/scat.rb/ruby/ruby-core/5081   (301 words)

  
 Ace Roqs’ Blog » Blog Archive » Liskov Substitution Principle
This is really the OOP principle of “require no more, promise no less,” also known as the Liskov Substitution Principle.  I guess I never made the connection between LSP and type theory, though it seems obvious in retrospect.  (Likely this is because I studied OOP and type theory during separate times.)
Basically, this is saying that objects that don’t follow LSP are not proper subtypes.  The C++ type system seems so fragile from this angle (something we knew already) - it’d be nice if there was a way to enforce formal pre- and post-conditions.
This entry was posted on Tuesday, February 28th, 2006 at 8:30 pm and is filed under Technical.
ace.roqs.net /?p=178   (243 words)

  
 Can IDEs Do More to Improve Code Quality? Part II
When one is sub typing by implementing an interface or extending an existing class, it is a good practice to follow the Liskov Substitution Principle.
In Java, this principle fits especially well when one is using the pre-conditions and post-conditions constructs that were introduced in the previous section.
Clearly, when one is modifying a Javadoc comment according to the LSP, one needs the whole specification under his eyes to avoid mistakes.
www.developer.com /design/print.php/10925_3346291_3   (728 words)

Try your search on: Qwika (all wikis)

Factbites
  About us   |   Why use us?   |   Reviews   |   Press   |   Contact us  
Copyright © 2005-2007 www.factbites.com Usage implies agreement with terms.