术语“多态性”从何而来?来自?
“多态性”一词从何而来?
Where did the term "polymorphism" come from?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
“多态性”一词从何而来?
Where did the term "polymorphism" come from?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
它来自希腊词根“poly”(许多)和“morphe”(形式)。多态对象可以采用多种形式(它可以由指向其任何祖先类的指针表示)。多态函数还可以采用多种形式(它可以对实际上不同类型的对象进行操作)。
It comes from the greek roots "poly" (many) and "morphe" (form). A polymorphic object can take on many forms (it can be represented by a pointer to any of its ancestor classes). A polymorphic function can also take on many forms (it can be made to operate on objects that are actually of different types).
多态这个词来自古希腊语。如果某物具有多个“形状/形式”,则它是多晶型的。
The word of Polymorphism comes from ancient greek. Something is polymorph, if it has more than one "shape/form".
好吧,程序员从生物学中偷走了这个术语。生物学的历史比 OOP 的历史要长得多!
看起来像继承层次结构,不是吗?
无论如何,多态性是指同一物种的两个成员可以具有完全不同的物理特征。它看起来像物种形成,但事实并非如此。给出的示例是“正常”捷豹和“深色变形”捷豹
另一个例子是性别二态性,
Well programmers stole the term from biology. Biology's been around much longer than OOP!
Looks like an inheritance hierarchy, doesn't it.
Anyway, polymorphism is when two members of the same species can have completely different physical traits. It looks like speciation, but it isn't. The example given is the "normal" jaguar and the "dark morph" jaguar
Another example is sexual dimorphism,
多态性是一个英语单词,其出现早于其在计算机科学中的使用。它的意思是“呈现不同形式或形状的能力”。 (参考http://en.wiktionary.org/wiki/polymorphism#Etymology)
这类似于计算机科学概念,其中一个对象可以被视为具有许多不同的类型。
Polymorphism is an English word that predates its use in computer science. It means "the ability to assume different forms or shapes." (reference http://en.wiktionary.org/wiki/polymorphism#Etymology)
This is analogous to the computer science concept in which an object can be treated as having many different types.