arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1606.03809cs.PL
收藏

为什么在OOP中命名类型很重要

Why Nominal-Typing Matters in OOP

Moez A. AbdelGawad

摘要:

“继承不是子类型”和“主流OO语言不必要地对继承进行限制”的说法已经在PL研究社区中流传多年。然而,许多主流OO开发人员和OO语言设计人员并不接受这些说法。在这些开发人员和语言设计人员非常熟悉的\emph{nominally-typed} OO语言中,继承只是子类型;他们认为OO类型继承是一个固有的名义概念,而不是结构概念。命名类型OO语言是当今最常用的程序设计语言之一。然而,名义类型对主流OO开发人员的价值,作为设计健壮的OO软件的一种手段,似乎正在等待PL研究人员的充分赞赏-从而使许多OO开发人员和语言设计人员以及许多OO PL研究人员之间的不必要的分裂永久化,每一方都在打折,如果不是甚至忽视,另一方的观点。在这篇文章中,我们加强了先前的努力,以证明名义类型的语义价值,提出了一个技术比较名义OO类型系统和结构OO类型系统。最近,一个领域理论模型的名义类型的面向对象程序进行了比较,著名的模型的结构类型的面向对象程序。结合起来,这些比较提供了一个明确和深入的帐户之间的关系,名义型和结构型面向对象类型系统,以前没有提出,他们帮助展示的关键价值,名义型和名义子类型面向对象开发人员和语言设计人员。我们相信,更清楚地了解纯名义OO类型的纯结构OO类型的关键语义优势,可以帮助弥补现有的分裂。我们相信,未来的基础OO PL研究,以进一步其相关的主流OOP,应该少基于结构模型的OOP和名义上的,而不是。

英文摘要:

The statements `inheritance is not subtyping' and `mainstream OO languages unnecessarily place restrictions over inheritance' have rippled as mantras through the PL research community for years. Many mainstream OO developers and OO language designers however do not accept these statements. In \emph{nominally-typed} OO languages that these developers and language designers are dearly familiar with, inheritance simply is subtyping; and they believe OO type inheritance is an inherently nominal notion not a structural one. Nominally-typed OO languages are among the most used programming languages today. However, the value of nominal typing to mainstream OO developers, as a means for designing robust OO software, seems to be in wait for full appreciation among PL researchers--thereby perpetuating an unnecessary schism between many OO developers and language designers and many OO PL researchers, with each side discounting, if not even disregarding, the views of the other. In this essay we strengthen earlier efforts to demonstrate the semantic value of nominal typing by presenting a technical comparison between nominal OO type systems and structural OO type systems. Recently, a domain-theoretic model of nominally-typed OOP was compared to well-known models of structurally-typed OOP. Combined, these comparisons provide a clear and deep account for the relation between nominal and structural OO type systems that has not been presented before, and they help demonstrate the key value of nominal typing and nominal subtyping to OO developers and language designers. We believe a clearer understanding of the key semantic advantage of pure nominal OO typing over pure structural OO typing can help remedy the existing schism. We believe future foundational OO PL research, to further its relevance to mainstream OOP, should be based less on structural models of OOP and more on nominal ones instead.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑