fbpx
维基百科

里氏替换原则

面向对象的程序设计中,里氏替换原则(Liskov Substitution principle)是对子类型的特别定义。它由芭芭拉·利斯科夫(Barbara Liskov)在1987年在一次会议上名为“数据的抽象与层次”的演说中首先提出。[1]

里氏替換原則由芭芭拉·利斯科夫提出,照片攝於2010年.

里氏替换原则的内容可以描述为: “派生类(子类)对象可以在程式中代替其基类(超类)对象。” 以上内容并非利斯科夫的原文,而是译自罗伯特·马丁(Robert Martin)对原文的解读。其原文为:

Let be a property provable about objects of type . Then should be true for objects of type where is a subtype of .

芭芭拉·利斯科夫周以真(Jeannette Wing)在1994年发表论文并提出以上的Liskov代換原則

引用 编辑

  1. ^ Liskov, Barbara. Data abstraction and hierarchy. 1987-10-04 [2008-03-23]. (原始内容于2019-06-30). 

參考文獻 编辑

一般參考

  • Leavens, Gary T.; Dhara, Krishna K. Concepts of Behavioral Subtyping and a Sketch of Their Extension to Component-Bases Systems. Leavens, Gary T.; Sitaraman, Murali (编). 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.
  • Liskov, B. H.; Wing, J. M. A behavioral notion of subtyping. ACM Trans. Program. Lang. Syst. 16 (6). November 1994: 1811–41. doi:10.1145/197320.197383.  参数|journal=与模板{{cite conference}}不匹配(建议改用{{cite journal}}|book-title=) (帮助)
    An updated version appeared: Liskov, Barbara; Wing, Jeannette. (技术报告). Carnegie Mellon University. July 1999 [2022-01-06]. CMU-CS-99-156. (原始内容存档于2012-07-16).  The formalization of the principle by its authors.
  • Plösch, Reinhold. 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.
  • Martin, Robert C. (PDF). C++ Report. March 1996. (原始内容 (PDF)存档于2015-11-28).  An article popular in the object-oriented programming community that gives several examples of LSP violations.
  • Majorinc, Kazimir. Ellipse-Circle Dilemma and Inverse Inheritance. ITI 98, Proceedings of the 20th International Conference of Information Technology Interfaces, Pula, 1998. : 627–632. ISSN 1330-1012. OCLC 894960131.  |journal=被忽略 (帮助) This paper discusses LSP in the mentioned context.

具體參考

  • Liskov, B. Keynote address — data abstraction and hierarchy. ACM SIGPLAN Notices. May 1988, 23 (5): 17–34. doi:10.1145/62139.62141.  A keynote address in which Liskov first formulated the principle.
  • Meyer, B. [[Object-oriented Software Construction|物件導向軟體構建英语Object-oriented Software Construction]]. Prentice Hall. 1988. ISBN 0-13-629031-0. 

参閲 编辑

  • SOLID - “SOLID”中的 L 指代了里氏替换原则
  • 類型簽名
  • 參考透明度英语Referential transparency(Referential transparency)
  • 求精法 (編程計算)英语Refinement (computing)(Refinement (computing))
  • 組合優於繼承英语Composition over inheritance(Composition over inheritance)

外部連結 编辑

  • Norvell, T.S. (PDF). 2003 [2022-01-06]. (原始内容 (PDF)存档于2022-01-30). 
  • Liskov Substitution Principle Explained (页面存档备份,存于互联网档案馆
  • SOLID Class Design: The Liskov Substitution Principle (页面存档备份,存于互联网档案馆
  • LSP: Liskov Substitution Principle (页面存档备份,存于互联网档案馆

里氏替换原则, 在面向对象的程序设计中, liskov, substitution, principle, 是对子类型的特别定义, 它由芭芭拉, 利斯科夫, barbara, liskov, 在1987年在一次会议上名为, 数据的抽象与层次, 的演说中首先提出, 里氏替換原則由芭芭拉, 利斯科夫提出, 照片攝於2010年, 的内容可以描述为, 派生类, 子类, 对象可以在程式中代替其基类, 超类, 对象, 以上内容并非利斯科夫的原文, 而是译自罗伯特, 马丁, robert, martin, 对原文的解读, 其原文. 在面向对象的程序设计中 里氏替换原则 Liskov Substitution principle 是对子类型的特别定义 它由芭芭拉 利斯科夫 Barbara Liskov 在1987年在一次会议上名为 数据的抽象与层次 的演说中首先提出 1 里氏替換原則由芭芭拉 利斯科夫提出 照片攝於2010年 里氏替换原则的内容可以描述为 派生类 子类 对象可以在程式中代替其基类 超类 对象 以上内容并非利斯科夫的原文 而是译自罗伯特 马丁 Robert Martin 对原文的解读 其原文为 Let q x displaystyle q x be a property provable about objects x displaystyle x of type T displaystyle T Then q y displaystyle q y should be true for objects y displaystyle y of type S displaystyle S where S displaystyle S is a subtype of T displaystyle T 芭芭拉 利斯科夫与周以真 Jeannette Wing 在1994年发表论文并提出以上的Liskov代換原則 目录 1 引用 2 參考文獻 3 参閲 4 外部連結引用 编辑 Liskov Barbara Data abstraction and hierarchy 1987 10 04 2008 03 23 原始内容存档于2019 06 30 參考文獻 编辑一般參考 Leavens Gary T Dhara Krishna K Concepts of Behavioral Subtyping and a Sketch of Their Extension to Component Bases Systems Leavens Gary T Sitaraman Murali 编 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 Liskov B H Wing J M A behavioral notion of subtyping ACM Trans Program Lang Syst 16 6 November 1994 1811 41 doi 10 1145 197320 197383 参数 journal 与模板 cite conference 不匹配 建议改用 cite journal 或 book title 帮助 An updated version appeared Liskov Barbara Wing Jeannette Behavioral Subtyping Using Invariants and Constraints 技术报告 Carnegie Mellon University July 1999 2022 01 06 CMU CS 99 156 原始内容存档于2012 07 16 The formalization of the principle by its authors Plosch Reinhold 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 Martin Robert C The Liskov Substitution Principle PDF C Report March 1996 原始内容 PDF 存档于2015 11 28 An article popular in the object oriented programming community that gives several examples of LSP violations Majorinc Kazimir Ellipse Circle Dilemma and Inverse Inheritance ITI 98 Proceedings of the 20th International Conference of Information Technology Interfaces Pula 1998 627 632 ISSN 1330 1012 OCLC 894960131 journal 被忽略 帮助 This paper discusses LSP in the mentioned context 具體參考 Liskov B Keynote address data abstraction and hierarchy ACM SIGPLAN Notices May 1988 23 5 17 34 doi 10 1145 62139 62141 A keynote address in which Liskov first formulated the principle Meyer B Object oriented Software Construction 物件導向軟體構建 英语 Object oriented Software Construction Prentice Hall 1988 ISBN 0 13 629031 0 参閲 编辑SOLID SOLID 中的 L 指代了里氏替换原则 類型簽名 參考透明度 英语 Referential transparency Referential transparency 求精法 編程計算 英语 Refinement computing Refinement computing 組合優於繼承 英语 Composition over inheritance Composition over inheritance 外部連結 编辑Norvell T S The Liskov Substitution Principle PDF 2003 2022 01 06 原始内容 PDF 存档于2022 01 30 Liskov Substitution Principle Explained 页面存档备份 存于互联网档案馆 SOLID Class Design The Liskov Substitution Principle 页面存档备份 存于互联网档案馆 LSP Liskov Substitution Principle 页面存档备份 存于互联网档案馆 取自 https zh wikipedia org w index php title 里氏替换原则 amp oldid 74961977, 维基百科,wiki,书籍,书籍,图书馆,

文章

,阅读,下载,免费,免费下载,mp3,视频,mp4,3gp, jpg,jpeg,gif,png,图片,音乐,歌曲,电影,书籍,游戏,游戏。