|
|
Line 1: |
Line 1: |
| {{Redirect|Substitutability|the economic principle|Substitute good}}
| | With regards to your desired number most typically associated with gems, you can purchase prepared intelligently to fight myself against any range you like. Is actually a exciting since it aids you enjoy like a experienced and you can worry just about anyone should a playing skills are robust.<br><br>If you have got to reload a real arms when playing deviate of clans hack that's shooting entailed, always think about cover first. This process is common for [http://Data.gov.uk/data/search?q=athletes athletes] to be gunned down while a reload is generally happening, and you wrist watch helplessly. Do And not let it happen for! Find somewhere to conceal before you start to reload.<br><br>Indeed be aware of how multi-ply player works. Should you have virtually any concerns with regards to where along with the way to use clash of clans hack no survey ([http://prometeu.net you can check here]), you'll be able to call us from our own web site. Regardless of whether you're investing in a real game exclusively for it is multiplayer, be sure you have everything required to suit this. If you really are planning on playing while fighting a person in your good household, you may stumble on that you will are after two copies of our clash of clans cheats to game against one another.<br><br>In the first instance clash of clans [http://Www.Bing.com/search?q=hack+tool&form=MSNNWS&mkt=en-us&pq=hack+tool hack tool] no survey generates believe in among their people. Society is just definitely powered by expert pressure, one of most of the most powerful forces about the planet. To be long as peer power utilizes its power as for good, clash of clans hack tool no critique will have its place in community.<br><br>Be certain to may not let computer games take over your daily life. Game titles can be quite additive, whenever your have to make indeed you moderate the moment that you investing guitar playing such games. Content articles invest an excessive level of time playing video game, your actual life would quite possibly begin to falter.<br><br>Varying time intervals before question the extent those it''s a 'strategy'" sports. A good moron without strategy in any existing respect will advance in the company of gamers over time. So long as anybody sign in occasionally and as well be sure your primary 'builders'" are building something, your game power are likely to increase. That''s every bit of there's going without going for walks shoes. Individuals which have been the most effective each of us in the game are, typically, those who can be actually playing a long, plus those who pay per click real cash to get a hold of extra builders. (Applying two builders, an special one can possibly most likely will be obtained for 500 gems which cost $4.99 and the next one particular particular costs 1000 gems.) With four builders, you will advance amongst people each and every doubly as fast just like a guy with two builders.<br><br>If you are playing a showing off activity, and you also don't possess knowledge including it, establish the ailment stage to rookie. This should help you pick-up in the excellent options that come while using the game and discover in your direction round the field. Should you set which it more than that, you'll get frustrated and suggests possess fun. |
| {{Solid principles}}
| |
| '''Substitutability''' is a principle in [[object-oriented programming]]. It states that, in a [[computer program]], if S is a [[subtype]] of T, then objects of [[datatype|type]] T may be replaced with objects of type S (i.e., objects of type S may be ''substituted'' for objects of type T) without altering any of the desirable properties of that program (correctness, task performed, etc.). More formally, the '''Liskov substitution principle''' ('''LSP''') is a particular definition of a [[subtyping]] relation, called '''(strong) behavioral subtyping''', that was initially introduced by [[Barbara Liskov]] in a 1987 conference keynote address entitled ''Data abstraction and hierarchy''. It is a [[Formal semantics of programming languages|semantic]] rather than merely syntactic relation because it intends to guarantee semantic interoperability of [[data type|types]] in a hierarchy, [[Object (computer science)|object type]]s in particular. [[Barbara Liskov]] and [[Jeannette Wing]] formulated the principle succinctly in a 1994 paper as follows:
| |
| | |
| :''Let <math>q(x)</math> be a property provable about objects <math>x</math> of type <math>T</math>. Then <math>q(y)</math> should be provable for objects <math>y</math> of type <math>S</math> where <math>S</math> is a subtype of <math>T</math>.''
| |
| | |
| In the same paper, Liskov and Wing detailed their notion of behavioral subtyping in an extension of [[Hoare logic]], which bears a certain resemblance with [[Bertrand Meyer]]'s [[Design by Contract]] in that it considers the interaction of subtyping with pre- and postconditions.
| |
| | |
| == Principle ==
| |
| | |
| Liskov's notion of a behavioral subtype defines a notion of substitutability for [[mutable]] objects; 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 (computer science)|correctness]]).
| |
| | |
| Behavioral subtyping is a stronger notion than typical [[subtyping of functions]] defined in [[type theory]], which relies only on the [[covariance and contravariance (computer science)|contravariance]] of argument types and [[covariance and contravariance (computer science)|covariance]] of the return type. Behavioral subtyping is trivially [[Undecidable problem|undecidable]] in general: if ''q'' is the property "method for ''x'' [[halting problem|always terminates]]", then it is impossible for a program (e.g. a compiler) to verify that it holds true for some subtype ''S'' of ''T'' even if ''q'' does hold for ''T''. Nonetheless, the principle is useful in reasoning about the design of class hierarchies.
| |
| | |
| Liskov's principle imposes some standard requirements on [[Type signature|signatures]] that have been adopted in newer object-oriented programming languages (usually at the level of classes rather than types; see [[Subtype#Subtyping schemes|nominal vs. structural subtyping]] for the distinction):
| |
| | |
| * [[Covariance and contravariance (computer science)|Contravariance]] of method arguments in the subtype.
| |
| * [[Covariance and contravariance (computer science)|Covariance]] of return types in the subtype.
| |
| * No new exceptions should be thrown by methods of the subtype, except where those exceptions are themselves subtypes of exceptions thrown by the methods of the supertype.
| |
| | |
| In addition to these, there are a number of behavioral conditions that the subtype must meet. These are detailed in a terminology resembling that of [[design by contract]] methodology, leading to some restrictions on how contracts can interact with [[Inheritance (computer science)|inheritance]]:
| |
| | |
| *[[Precondition]]s cannot be strengthened in a subtype.
| |
| *[[Postcondition]]s cannot be weakened in a subtype.
| |
| *[[Invariant (computer science)|Invariant]]s of the supertype must be preserved in a subtype.
| |
| * History constraint (the "history rule"). Objects are regarded as being modifiable only through their methods ([[Encapsulation (computer science)|encapsulation]]). Since subtypes may introduce methods that are not present in the supertype, the introduction of these methods may allow state changes in the subtype that are not permissible in the supertype. The history constraint prohibits this. It was the novel element introduced by Liskov and Wing. A violation of this constraint can be exemplified by defining a ''mutable point'' as a subtype of an ''immutable point''. This is a violation of the history constraint, because in the history of the ''immutable point'', the state is always the same after creation, so it cannot include the history of a ''mutable point'' in general. Fields added to the subtype may however be safely modified because they are not observable through the supertype methods. Thus, one may derive ''a circle with fixed center but mutable radius'' from ''immutable point'' without violating LSP.
| |
| | |
| == Origins ==
| |
| | |
| The rules on pre- and postconditions are identical to those introduced by Bertrand Meyer in his 1988 book. Both Meyer, and later Pierre America, who was the first to use the term ''behavioral subtyping'', gave [[proof-theoretic]] definitions of some behavioral subtyping notions, but their definitions did not take into account [[Aliasing (computing)|aliasing]] that may occur in programming language that supports references or pointers. Taking aliasing into account was the major improvement made by Liskov and Wing (1994), and a key ingredient is the history constraint. Under the definitions of Meyer and America, a MutablePoint would be a behavioral subtype of ImmutablePoint, whereas LSP forbids this.
| |
| | |
| == A typical violation ==
| |
| {{further2|[[Circle-ellipse problem]]}}
| |
| A typical example that violates LSP is a Square class that derives from a Rectangle class, assuming getter and setter methods exist for both width and height. The Square class always assumes that the width is equal with the height. If a Square object is used in a context where a Rectangle is expected, unexpected behavior may occur because the dimensions of a Square cannot (or rather should not) be modified independently. This problem cannot be easily fixed: if we can modify the setter methods in the Square class so that they preserve the Square invariant (i.e., keep the dimensions equal), then these methods will weaken (violate) the [[postcondition]]s for the Rectangle setters, which state that dimensions can be modified independently. Violations of LSP, like this one, may or may not be a problem in practice, depending on the postconditions or invariants that are actually expected by the code that uses classes violating LSP. Mutability is a key issue here. If Square and Rectangle had only getter methods (i.e., they were [[immutable object]]s), then no violation of LSP could occur.
| |
| | |
| == See also ==
| |
| * [[Program refinement|Refinement]]
| |
| * [[Solid (object-oriented design)|SOLID]]: the L in SOLID stands for Liskov substitution principle
| |
| * [[Type signature]]
| |
| * [[Composition over inheritance]]
| |
| | |
| == References ==
| |
| '''General references'''
| |
| {{refbegin}}
| |
| * [[Gary T. Leavens]] and Krishna K. Dhara, ''Concepts of Behavioral Subtyping and a Sketch of Their Extension to Component-Bases Systems'' in Gary T. Leavens, Murali Sitaraman, (ed.) ''Foundations of component-based systems'', Cambridge University Press, 2000 ISBN 0-521-77164-1. This paper surveys various notions of behavioral subtyping, including Liskov and Wing's.
| |
| * {{cite doi|10.1145/197320.197383}} An updated version appeared as CMU technical report: {{cite web|url=http://reports-archive.adm.cs.cmu.edu/anon/1999/CMU-CS-99-156.ps|title=Behavioral Subtyping Using Invariants and Constraints|last=Liskov|first=Barbara|authorlink=Barbara Liskov|coauthors=[[Jeannette Wing|Wing, Jeannette]]|date=July 1999|format=[[PostScript|PS]]|accessdate=2006-10-05}} The formalization of the principle by its authors.
| |
| * Reinhold Plösch, ''Contracts, scenarios and prototypes: an integrated approach to high quality software'', Springer, 2004, ISBN 3-540-43486-0. Contains a gentler introduction to behavioral subtyping in its various forms in chapter 2.
| |
| * [[Robert C. Martin]], [http://www.objectmentor.com/resources/articles/lsp.pdf The Liskov Substitution Principle], C++ Report, March 1996. An article popular in the object-oriented programming community that gives several examples of LSP violations.
| |
| * Kazimir Majorinc, Ellipse-Circle Dilemma and Inverse Inheritance, ITI 98, Proceedings of the 20th International Conference of Information Technology Interfaces, Pula, 1998, ISSN 1330-1012. This paper discusses LSP in the mentioned context.
| |
| {{refend}}
| |
| '''Specific references'''
| |
| {{refbegin}}
| |
| * {{cite doi|10.1145/62139.62141}} A keynote address in which Liskov first formulated the principle.
| |
| * Meyer B., ''[[Object-oriented Software Construction]]'', Prentice Hall, New York, 1988, ISBN 0-13-629031-0
| |
| {{refend}}
| |
| | |
| == External links ==
| |
| * [http://www.engr.mun.ca/~theo/Courses/sd/5895-downloads/sd-principles-3.ppt.pdf The Liskov Substitution Principle], T. S. Norvell, 2003
| |
| | |
| {{DEFAULTSORT:Liskov Substitution Principle}}
| |
| [[Category:Object-oriented programming]]
| |
| [[Category:Type theory]]
| |
| [[Category:Programming principles]]
| |
| [[Category:Formal methods]]
| |
| [[Category:Programming language semantics]]
| |
With regards to your desired number most typically associated with gems, you can purchase prepared intelligently to fight myself against any range you like. Is actually a exciting since it aids you enjoy like a experienced and you can worry just about anyone should a playing skills are robust.
If you have got to reload a real arms when playing deviate of clans hack that's shooting entailed, always think about cover first. This process is common for athletes to be gunned down while a reload is generally happening, and you wrist watch helplessly. Do And not let it happen for! Find somewhere to conceal before you start to reload.
Indeed be aware of how multi-ply player works. Should you have virtually any concerns with regards to where along with the way to use clash of clans hack no survey (you can check here), you'll be able to call us from our own web site. Regardless of whether you're investing in a real game exclusively for it is multiplayer, be sure you have everything required to suit this. If you really are planning on playing while fighting a person in your good household, you may stumble on that you will are after two copies of our clash of clans cheats to game against one another.
In the first instance clash of clans hack tool no survey generates believe in among their people. Society is just definitely powered by expert pressure, one of most of the most powerful forces about the planet. To be long as peer power utilizes its power as for good, clash of clans hack tool no critique will have its place in community.
Be certain to may not let computer games take over your daily life. Game titles can be quite additive, whenever your have to make indeed you moderate the moment that you investing guitar playing such games. Content articles invest an excessive level of time playing video game, your actual life would quite possibly begin to falter.
Varying time intervals before question the extent those its a 'strategy'" sports. A good moron without strategy in any existing respect will advance in the company of gamers over time. So long as anybody sign in occasionally and as well be sure your primary 'builders'" are building something, your game power are likely to increase. Thats every bit of there's going without going for walks shoes. Individuals which have been the most effective each of us in the game are, typically, those who can be actually playing a long, plus those who pay per click real cash to get a hold of extra builders. (Applying two builders, an special one can possibly most likely will be obtained for 500 gems which cost $4.99 and the next one particular particular costs 1000 gems.) With four builders, you will advance amongst people each and every doubly as fast just like a guy with two builders.
If you are playing a showing off activity, and you also don't possess knowledge including it, establish the ailment stage to rookie. This should help you pick-up in the excellent options that come while using the game and discover in your direction round the field. Should you set which it more than that, you'll get frustrated and suggests possess fun.