 |
at Global Oneness Community.
Share your dreams and let others help you with the interpretation!
Dream Sharing Forum
|
 |
Liskov substitution principle | A Wisdom Archive on Liskov substitution principle |  | Liskov substitution principle A selection of articles related to Liskov substitution principle |  |
| We recommend this article: Liskov substitution principle - 1, and also this: Liskov substitution principle - 2. |
|
More material related to Liskov Substitution Principle can be found here:
|
|
|  | | Liskov substitution principle |  | | » Page 1 « Page 2 |  |
 | |
| ARTICLES RELATED TO Liskov substitution principle |  |  |  | Liskov substitution principle: Encyclopedia II - Datatype - Compatibility equivalence and substitutabilityThe question of compatibility and equivalence becomes a complicated and controversial topic and relates to the problem of substitutability; in other words: given type A and type B, are they equal types or compatible? Can one use the value with type B in the place of the value with type A?
If type A is compatible with type B, A is a subtype of B (but not always vice versa) - according to the Liskov substitution principle.
Type conversion may ...
See also:Datatype, Datatype - Basis, Datatype - Type checking, Datatype - Static and dynamic typing, Datatype - Static and dynamic type checking in practice, Datatype - Strong and weak typing, Datatype - Polymorphism and types, Datatype - Explicit or implicit declaration and inference, Datatype - Collections of types, Datatype - Specialized types, Datatype - Compatibility equivalence and substitutability Read more here: » Datatype: Encyclopedia II - Datatype - Compatibility equivalence and substitutability |
|  |
|
 |  |  | Liskov substitution principle: Encyclopedia II - Datatype - Compatibility equivalence and substitutability
The question of compatibility and equivalence becomes a complicated and controversial topic and relates to the problem of substitutability; in other words: given type A and type B, are they equal types or compatible? Can one use the value with type B in the place of the value with type A?
If type A is compatible with type B, A is a subtype of B (but not always vice versa) - according to the Liskov substitution principle.
Type conversion may ...
See also:Datatype, Datatype - Basis, Datatype - Type checking, Datatype - Static and dynamic typing, Datatype - Static and dynamic type checking in practice, Datatype - Strong and weak typing, Datatype - Polymorphism and types, Datatype - Explicit or implicit declaration and inference, Datatype - Collections of types, Datatype - Specialized types, Datatype - Compatibility equivalence and substitutability, Datatype - Nominative vs structural typing Read more here: » Datatype: Encyclopedia II - Datatype - Compatibility equivalence and substitutability |
|  |
|
 |  |  | Liskov substitution principle: Encyclopedia II - Polymorphism computer science - Subtyping polymorphismSome languages employ the idea of subtypes to restrict the range of types that can be used in a particular case of parametric polymorphism. In these languages, subtyping polymorphism (sometimes referred to as dynamic polymorphism or dynamic typing) allows a function to be written to take an object of a certain type T, but also work correctly if passed an object that belongs to a type S that is a subtype of T (according to the Liskov substitution principle). This type relation is sometimes written S <: T. Conversely, T is said to be a < ...
See also:Polymorphism computer science, Polymorphism computer science - Parametric polymorphism, Polymorphism computer science - Predicative and impredicative polymorphism, Polymorphism computer science - Subtyping polymorphism, Polymorphism computer science - Ad-hoc polymorphism, Polymorphism computer science - Overloading, Polymorphism computer science - Coercion, Polymorphism computer science - Example, Polymorphism computer science - Overloading, Polymorphism computer science - Coercion, Polymorphism computer science - Parametric polymorphism Read more here: » Polymorphism computer science: Encyclopedia II - Polymorphism computer science - Subtyping polymorphism |
|  |
|
|
|
 |  |  | Liskov substitution principle: Encyclopedia II - Datatype - Type checkingThe process of verifying and enforcing the constraints of types - type checking - may occur either at compile-time (a static check) or run-time (a dynamic check). Static type-checking becomes a primary task of the semantic analysis carried out by a compiler. If a language enforces type rules strongly (that is, generally allowing only those automatic type conversions which do not lose information), one can refer to the process as strongly typed, if not, as weakly typed.
Da ...
See also:Datatype, Datatype - Basis, Datatype - Type checking, Datatype - Static and dynamic typing, Datatype - Static and dynamic type checking in practice, Datatype - Strong and weak typing, Datatype - Polymorphism and types, Datatype - Explicit or implicit declaration and inference, Datatype - Collections of types, Datatype - Specialized types, Datatype - Compatibility equivalence and substitutability Read more here: » Datatype: Encyclopedia II - Datatype - Type checking |
|  |
|
|
 |  |  | Liskov substitution principle: Encyclopedia II - Datatype - Type checkingThe process of verifying and enforcing the constraints of types - type checking - may occur either at compile-time (a static check) or run-time (a dynamic check). Static type-checking becomes a primary task of the semantic analysis carried out by a compiler. If a language enforces type rules strongly (that is, generally allowing only those automatic type conversions which do not lose information), one can refer to the process as strongly typed, if not, as weakly typed.
Da ...
See also:Datatype, Datatype - Basis, Datatype - Type checking, Datatype - Static and dynamic typing, Datatype - Static and dynamic type checking in practice, Datatype - Strong and weak typing, Datatype - Polymorphism and types, Datatype - Explicit or implicit declaration and inference, Datatype - Collections of types, Datatype - Specialized types, Datatype - Compatibility equivalence and substitutability, Datatype - Nominative vs structural typing Read more here: » Datatype: Encyclopedia II - Datatype - Type checking |
|  |
|
 |  |  | Liskov substitution principle: Encyclopedia II - Polymorphism computer science - Parametric polymorphismUsing parametric polymorphism, a function or datatype can be written generically so that it can deal equally well with any objects without depending on their type. For example, a function append that joins two lists can be constructed so that it does not care about the type of elements: it can append lists of integers, lists of real numbers, lists of strings, and so on. Let the type variable a denote the type of elements in the lists. Then append can be typed [a] × [a] ...
See also:Polymorphism computer science, Polymorphism computer science - Parametric polymorphism, Polymorphism computer science - Predicative and impredicative polymorphism, Polymorphism computer science - Subtyping polymorphism, Polymorphism computer science - Ad-hoc polymorphism, Polymorphism computer science - Overloading, Polymorphism computer science - Coercion, Polymorphism computer science - Example, Polymorphism computer science - Overloading, Polymorphism computer science - Coercion, Polymorphism computer science - Parametric polymorphism Read more here: » Polymorphism computer science: Encyclopedia II - Polymorphism computer science - Parametric polymorphism |
|  |
|
|
 |  |  | Liskov substitution principle: Encyclopedia II - Polymorphism in object-oriented programming - ExamplesPython makes extensive use of polymorphism in its basic types. For example, strings (immutable sequences of characters) and lists (mutable sequences of elements of any type) have the same indexing interface and the same lookup interface (which call the appropriate underlying methods).
myString = 'Hello world'
myList = [0, 'one', 1, 'two', 3, 'five', 8]
print myString[:4] # prints Hell
print myList[:4] # prints [0, 'one', 1, 'two']
print 'e' ...
See also:Polymorphism in object-oriented programming, Polymorphism in object-oriented programming - Advantages of polymorphism, Polymorphism in object-oriented programming - Examples, Polymorphism in object-oriented programming - Other concepts Read more here: » Polymorphism in object-oriented programming: Encyclopedia II - Polymorphism in object-oriented programming - Examples |
|  |
|
 |  |  | Liskov substitution principle: Encyclopedia II - Datatype - Nominative vs structural typingThere are two primary schemes for determing whether two types are equivalent and/or subtypes; nominative (by name) and structural (by structure). As the names indicate, nominative type systems operate based on explicit annotations in the code; types are not "recognized" unless explicitly declared, and subtype relationships also must be explicitly declared. Structural type systems, on the other hand, perform type judgements based on the structure of the two types under consideration.
Few languages are strictly nomi ...
See also:Datatype, Datatype - Basis, Datatype - Type checking, Datatype - Static and dynamic typing, Datatype - Static and dynamic type checking in practice, Datatype - Strong and weak typing, Datatype - Polymorphism and types, Datatype - Explicit or implicit declaration and inference, Datatype - Collections of types, Datatype - Specialized types, Datatype - Compatibility equivalence and substitutability, Datatype - Nominative vs structural typing Read more here: » Datatype: Encyclopedia II - Datatype - Nominative vs structural typing |
|  |
|
|
 |  |  | Liskov substitution principle: Encyclopedia II - Datatype - Explicit or implicit declaration and inferenceMany static type systems, such as C's and Java's, require type declarations: the programmer must explicitly associate each variable with a particular type. Others, such as Haskell's, perform type inference: the compiler draws conclusions about the types of variables based on how programmers use those variables. For example, given a function f(x,y) which adds x and y together, the compiler can infer that x and y must be numbers -- since addition is only defined for numbers. Therefore, any call to f elsewhere in the program that specifies a non-nu ...
See also:Datatype, Datatype - Basis, Datatype - Type checking, Datatype - Static and dynamic typing, Datatype - Static and dynamic type checking in practice, Datatype - Strong and weak typing, Datatype - Polymorphism and types, Datatype - Explicit or implicit declaration and inference, Datatype - Collections of types, Datatype - Specialized types, Datatype - Compatibility equivalence and substitutability, Datatype - Nominative vs structural typing Read more here: » Datatype: Encyclopedia II - Datatype - Explicit or implicit declaration and inference |
|  |
|
|
 |  |  | Liskov substitution principle: Encyclopedia II - Datatype - BasisAssigning datatypes ("typing") has the basic purpose of giving some semantic meaning to otherwise meaningless collections of bits. Types usually have associations either with values in memory or with objects such as variables. Because any value simply consists of a set of bits in a computer, hardware makes no distinction even between memory addresses, instruction code, characters, integers and floating-point numbers. Types inform programs and programmers how ...
See also:Datatype, Datatype - Basis, Datatype - Type checking, Datatype - Static and dynamic typing, Datatype - Static and dynamic type checking in practice, Datatype - Strong and weak typing, Datatype - Polymorphism and types, Datatype - Explicit or implicit declaration and inference, Datatype - Collections of types, Datatype - Specialized types, Datatype - Compatibility equivalence and substitutability, Datatype - Nominative vs structural typing Read more here: » Datatype: Encyclopedia II - Datatype - Basis |
|  |
|
 |  |  | Liskov substitution principle: Encyclopedia II - Datatype - Explicit or implicit declaration and inferenceMany static type systems, such as C's and Java's, require type declarations: the programmer must explicitly associate each variable with a particular type. Others, such as Haskell's, perform type inference: the compiler draws conclusions about the types of variables based on how programmers use those variables. For example, given a function f(x,y) which adds x and y together, the compiler can infer that x and y must be numbers -- since addition is only defined for numbers. Therefore, any call to f elsewhere in the program that specifies a non-nu ...
See also:Datatype, Datatype - Basis, Datatype - Type checking, Datatype - Static and dynamic typing, Datatype - Static and dynamic type checking in practice, Datatype - Strong and weak typing, Datatype - Polymorphism and types, Datatype - Explicit or implicit declaration and inference, Datatype - Collections of types, Datatype - Specialized types, Datatype - Compatibility equivalence and substitutability Read more here: » Datatype: Encyclopedia II - Datatype - Explicit or implicit declaration and inference |
|  |
|
 |  |  | Liskov substitution principle: Encyclopedia II - Datatype - Strong and weak typingMain article: strongly-typed programming language
For a fuller discussion of the different meanings of the phrase strongly typed, see strongly-typed programming language.
One definition of strongly typed involves not allowing an operation to succeed on arguments which have the wrong type. A C cast gone wrong exemplifies the absence of strong typing; if a programmer casts a value in C, not only must the compiler allow the code, but the runtime should allow it as well. This allows compact and fas ...
See also:Datatype, Datatype - Basis, Datatype - Type checking, Datatype - Static and dynamic typing, Datatype - Static and dynamic type checking in practice, Datatype - Strong and weak typing, Datatype - Polymorphism and types, Datatype - Explicit or implicit declaration and inference, Datatype - Collections of types, Datatype - Specialized types, Datatype - Compatibility equivalence and substitutability Read more here: » Datatype: Encyclopedia II - Datatype - Strong and weak typing |
|  |
|
 |  |  | Liskov substitution principle: Encyclopedia II - Polymorphism computer science - Ad-hoc polymorphismAd-hoc polymorphism usually refers to simple overloading, but sometimes automatic type conversion, known as coercion, is also considered to be a kind of ad-hoc polymorphism (see the example section below). Common to these two types is the fact that the programmer has to specify exactly what types are to be usable with the polymorphic function.
The name refers to the manner in which this kind of polymorphism is typically introduced: "Oh, hey, let's make the + operator work on strings, too!" Some argue ...
See also:Polymorphism computer science, Polymorphism computer science - Parametric polymorphism, Polymorphism computer science - Predicative and impredicative polymorphism, Polymorphism computer science - Subtyping polymorphism, Polymorphism computer science - Ad-hoc polymorphism, Polymorphism computer science - Overloading, Polymorphism computer science - Coercion, Polymorphism computer science - Example, Polymorphism computer science - Overloading, Polymorphism computer science - Coercion, Polymorphism computer science - Parametric polymorphism Read more here: » Polymorphism computer science: Encyclopedia II - Polymorphism computer science - Ad-hoc polymorphism |
|  |
|
 |  |  | Liskov substitution principle: Encyclopedia II - Polymorphism computer science - ExampleThis example aims to illustrate three different kinds of polymorphism described in this article. Though overloading an originally arithmetic operator to do a wide variety of things in this way may not be the most clear-cut example, it allows some subtle points to be made. In practice, the different types of polymorphism are not generally mixed up as much as they are here.
Imagine, if you will, an operator + that may be used in the following ways:
1 + 2 → 3
3.14 + 0.0015 → 3.141 ...
See also:Polymorphism computer science, Polymorphism computer science - Parametric polymorphism, Polymorphism computer science - Predicative and impredicative polymorphism, Polymorphism computer science - Subtyping polymorphism, Polymorphism computer science - Ad-hoc polymorphism, Polymorphism computer science - Overloading, Polymorphism computer science - Coercion, Polymorphism computer science - Example, Polymorphism computer science - Overloading, Polymorphism computer science - Coercion, Polymorphism computer science - Parametric polymorphism Read more here: » Polymorphism computer science: Encyclopedia II - Polymorphism computer science - Example |
|  |
|
 | | » Page 1 « Page 2 |  |
 | |
|
|
More material related to Liskov Substitution Principle can be found here:
|
|
|
Search the Global Oneness web site |
|
|
|
 |
|