| dbpprop:abstract
|
- In object-oriented programming, 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 semantic rather than merely syntactic relation because it intends to guarantee semantic interoperability of types in a hierarchy, object types in particular. 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 true 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 and pre- and postconditions.
- Das liskovsche Substitutionsprinzip (LSP) oder Ersetzbarkeitsprinzip ist ein Kriterium in der objektorientierten Programmierung, das die notwendigen Bedigungen zur Modellierung eines Datentyp als Subtyp eines anderen angibt. Das liskovsche Substitutionsprinzip wurde 1993 von Barbara Liskov und Jeannette Wing formuliert. In einem nachfolgenden Artikel wurde es folgendermaßen formuliert (Übersetzung): Eine stärkere Forderung [als Kovarianz und Kontravarianz] wird benötigt, die das Verhalten von Untertypen einschränkt: Eigenschaften, die anhand der Spezifikation des vermeintlichen Typs eines Objektes bewiesen werden können, sollten auch dann gelten, wenn das Objekt einem Untertyp dieses Typs angehört: Sei <math>q(x)</math> eine beweisbare Eigenschaft von Objekten <math>x</math> des Typs <math>T</math>. Dann soll <math>q(y)</math> für Objekte <math>y</math> des Typs <math>S</math> wahr sein, wobei <math>S</math> ein Untertyp von <math>T</math> ist. Damit ist garantiert, dass Operationen, die auf ein Objekt des Typs <math>T</math> vom Typ <math>S</math> anwendet werden, auch korrekt ausgeführt werden. In einigen den heute übliche Programmiersprachen, die Polymorphie unterstützen, kann dieses Prinzip durch Vererbung von mehr als einem Objekt auf ein anderes, verletzt werden. Dann ließe sich nicht stets bedenkenlos ein Objekt vom Typ <math>T</math> durch ein Objekt vom Typ <math>S</math> ersetzen.
- Le principe de substitution de Liskov est, en programmation orientée objet, une définition particulière de la notion de sous-type. Il a été formulé par Barbara Liskov et Jeannette Wing dans un article intitulé Family Values: A Behavioral Notion of Subtyping Liskov et Wing en ont proposé la formulation condensée suivante : Si <math>q(x)</math> est une propriété démontrable pour tout objet <math>x</math> de type <math>T</math>, alors <math>q(y)</math> est vraie pour tout objet <math>y</math> de type <math>S</math> tel que <math>S</math> est un sous-type de <math>T</math>. Ainsi, la notion de sous-type telle que définie par Liskov et Wing est fondée sur la notion de substituabilité : si <math>S</math> est un sous-type de <math>T</math>, alors tout objet de type <math>T</math> peut être remplacé par un objet de type <math>S</math> sans altérer les propriétés désirables du programme concerné .
- Nella programmazione orientata agli oggetti il principio di sostituzione di Liskov è una particolare definizione di sottotipo, introdotta da Barbara Liskov e Jeannette Wing nel 1993. La formulazione sintetica del principio è la seguente: "Se <math>q(x)</math> è una proprietà che si può dimostrare essere valida per oggetti <math>x</math> di tipo <math>T</math>, allora <math>q(y)</math> deve essere valida per oggetti <math>y</math> di tipo <math>S</math> dove <math>S</math> è un sottotipo di <math>T</math>. " Questa nozione di sottotipo è quindi basata sulla nozione di sostituibilità secondo cui, se S è un sottotipo di T, allora oggetti dichiarati in un programma di tipo T possono essere sostituiti con oggetti di tipo S senza alterare la correttezza dei risultati del programma. Nella metodologia di programmazione chiamata progettazione per contratto (Design by contract), questo principio pone alcuni vincoli sulle modalità con cui i contratti possono interagire con l'ereditarietà: i prerequisiti richiesti ad una superclasse devono essere almeno altrettanto vincolanti di quelli richiesti alle sottoclassi; le postcondizioni e gli invarianti in una sottoclasse devono essere almeno altrettanto vincolanti di quelle delle sue superclassi. Inoltre il principio non ammette la presenza di eccezioni nelle sottoclassi. In termini più concreti, il principio di sostituzione (anche detto di sostituibilità) di Liskov influenza e definisce il quinto principio del paradigma object oriented, il principio di Classificazione, in questo senso: "le sottoclassi devono sempre esporre la stessa interfaccia pubblica della loro superclasse più astratta, senza aggiungere né togliere nulla". Le uniche differenze ammesse nelle sottoclassi sono differenze di comportamento, cioè di implementazione dei servizi medesimi. Una sottoclasse che rispetta il principio di sostituzione di Liskov, e allo stesso tempo implementa comportamenti diversi dalla sua superclasse, viene definita Bad Child.
- リスコフの置換原則(りすこふのちかんげんそく、英: Liskov substitution principle)とは、オブジェクト指向プログラミングにおける派生型の定義の一種であり、1993年、バーバラ・リスコフと Jeannette Wing が論文 Family Values: A Behavioral Notion of Subtyping で提唱した。なお、これが派生型の唯一の定義ではない(データ型参照)。 この原則は、次のように簡潔に定式化されている: <math>T</math> 型のオブジェクト <math>x</math> に関して真となる属性を <math>q(x)</math> とする。このとき <math>S</math> が <math>T</math> の派生型であれば、<math>S</math> 型のオブジェクト <math>y</math> について <math>q(y)</math> が真となる。 すなわち、リスコフと Wing が定式化した派生型の定義は、「置換可能性; substitutability」に基づいている。S が T の派生型であれば、プログラム内で T 型のオブジェクトが使われている箇所は全て S 型のオブジェクトで置換可能であり、それによってプログラムの動作は全く変化しない(正当性参照)。
- Na programação orientada a objeto, o princípio da substituição de Liskov é uma definição particular para o conceito de subtipo. Foi introduzido em 1993 por Barbara Liskov e Jeannette Wing através de um artigo de nome Family Values: A Behavioral Notion of Subtyping. Para outra definição de subtipo ver tipo de dado. O princípio foi definido de forma resumida como: Se <math>q(x)</math> é uma propriedade demonstrável dos objetos <math>x</math> de tipo <math>T</math>. Então <math>q(y)</math> deve ser verdadeiro para objetos <math>y</math> de tipo <math>S</math> onde <math>S</math> é um subtipo de <math>T</math>. Portanto, a visão de "subtipo" defendida por Liskov e Wing é baseada na noção da substituição; isto é, se S é um subtipo de T, então os objetos do tipo T, em um programa, podem ser substituídos pelos objetos de tipo S sem que seja necessário alterar as propriedades deste programa.
- В объектно-ориентированном программировании, Принцип подстановки Лисков (LSP) является специфичным определением подтипа предложенным Барбарой Лисков в 1987 году на конференции в основном докладе под названием Абстракция данных и иерархия В последующей статье Лисков кратко сформулировала свой принцип следующим образом: Пусть <math>q(x)</math> является свойством верным относительно объектов <math>x</math> некоторого типа <math>T</math>. Тогда <math>q(y)</math> также должно быть верным для объектов <math>y</math> типа <math>S</math>, где <math>S</math> является подтипом типа <math>T</math>. Таким образом, идея Лисков о «подтипе» дает определение понятия замещения — если S является подтипом T, тогда объекты типа T в программе могут быть замещены объектами типа S без каких либо изменений желательных свойств этой программы. Этот принцип является важнейшим критерием для оценки качества принимаемых решений при построении иерархий наследования. Сформулировать его можно в виде простого правила: тип S будет подтипом Т тогда и только тогда, когда каждому объекту oS типа S соответствует некий объект oT типа T таким образом, что для всех программ P, реализованных в терминах T, поведение P не будет меняться, если oT заменить на oS.
- В об'єктно-орієнтованому програмуванні, Принцип підстановки Ліско (англ. Liskov Substitution Principle, LSP) — це спеціальне визначення підтипу запропоноване Барбарою Ліско в 1987 році на конференції в доповіді під назвою Абстракція даних та ієрархія В наступній статті Ліско сформулювала свій принцип наступним чином: Нехай <math>q (x)</math> є властивістю вірною для об'єктів <math>x </math> деякого типу <math>T</math>. Тоді <math>q(y)</math> також має бути вірним для об'єктів <math>y</math> типу <math>S</math>, де <math> S </math> — підтип типу <math>T</math>. Таким чином, ідея Ліско про «підтип» визначає поняття заміщення — якщо S підтип T, тоді об'єкти типу T в програмі можуть бути заміщені об'єктами типу S без будь-яких змін бажаних властивостей цієї програми. Цей принцип — найважливіший критерій для оцінки якості ухвалених рішень при побудові ієрархій успадкування. Сформулювати його можна у вигляді простого правила: тип S буде підтипом Т тоді і тільки тоді, коли кожному об'єкту o1 типу S відповідає певний об'єкт o2 типу T таким чином, що для всіх програм P, реалізованих в термінах T, поведінка P не зміниться, якщо o1 замінити на o2.
- 在面向对象的程序设计中,Liskov替换原则是对子类型的特别定义。它由芭芭拉·利斯科夫(Barbara Liskov)在1987年在一次会议上名为“数据的抽象与层次”的演说中首先提出。 Liskov替换原则的内容可以描述为: “派生类(子类)对象能够替换其基类(超类)对象被使用。” 以上内容并非Barbara Liskov的原文,而是译自Robert Martin对原文的解读。其原文为: 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 true for objects <math>y</math> of type <math>S</math> where <math>S</math> is a subtype of <math>T</math>.
|
| rdfs:comment
|
- In object-oriented programming, 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 semantic rather than merely syntactic relation because it intends to guarantee semantic interoperability of types in a hierarchy, object types in particular.
- Das liskovsche Substitutionsprinzip (LSP) oder Ersetzbarkeitsprinzip ist ein Kriterium in der objektorientierten Programmierung, das die notwendigen Bedigungen zur Modellierung eines Datentyp als Subtyp eines anderen angibt. Das liskovsche Substitutionsprinzip wurde 1993 von Barbara Liskov und Jeannette Wing formuliert.
- Le principe de substitution de Liskov est, en programmation orientée objet, une définition particulière de la notion de sous-type.
- Nella programmazione orientata agli oggetti il principio di sostituzione di Liskov è una particolare definizione di sottotipo, introdotta da Barbara Liskov e Jeannette Wing nel 1993.
- Na programação orientada a objeto, o princípio da substituição de Liskov é uma definição particular para o conceito de subtipo. Foi introduzido em 1993 por Barbara Liskov e Jeannette Wing através de um artigo de nome Family Values: A Behavioral Notion of Subtyping. Para outra definição de subtipo ver tipo de dado.
- В об'єктно-орієнтованому програмуванні, Принцип підстановки Ліско (англ.
|