计算机英语翻译-oop的基本思想2(高分赠送)

来源:百度知道 编辑:UC知道 时间:2024/06/04 06:38:15
对象的产生有两种基本方式。一种是以原型(prototype)对象为基础产生新的对象。一种是以类(class)为基础产生新对象。原型的概念已经在认知心理学中被用来解释概念学习的递增特性,原型模型本身就是企图通过提供一个有代表性的对象为基础来产生各种新的对象,并由此继续产生更符合实际应用的对象。而原型-委托也是OOP中的对象抽象,代码共享机制中的一种。一个类提供了一个或者多个对象的通用性描叙。从形式化的观点看,类与类型有关,因此一个类相当于是从该类中产生的实例的集合。而这样的观点也会带来一些矛盾,比较典型的就是在继承体系下,子集(子类)对象和父集(父类)对象之间的行为相融性可能很难达到,这也就是OOP中常被引用的---子类型(subtype)不等于子类(subclass)[Budd 2002]。而在一种所有皆对象的世界观背景下,在类模型基础上还诞生出了一种拥有元类(metaclass)的新对象模型。即类本身也是一种其他类的对象。以上三种根本不同的观点各自定义了三种基于类(class-based),基于原型(prototype-based)和基于元类(metaclass-based)的对象模型。而这三种对象模型也就导致了许多不同的程序设计语言(如果我们暂时把静态与动态的差别放在一边)。是的,我们经常接触的C++,Java都是使用基于类的对象模型,但除此之外还有很多我们所没有接触的OOPL采用了完全不一样的对象模型,他们是在用另外一种观点诠释OOP的内涵。

如下 请过目:
There are two basic methods for creating objects: prototype-based object creation and class-based object creation. Concept of prototype has been used in cognitive psychology to explain the increment trait in concept acquisition. Prototype model itself is aimed to create various new objects via providing a representative object and generates more objects in line with the actual application. And prototype-commissioned is abstract object in OOP, a type of code-sharing mechanism as well. A class provides common description for one or more objects. Seen from the form ,the class is related to class type. So a class is a set of applications derived from a set class.
Such views may bring some contradictions. Some typical examples are as this: In some succession system, compatibility between subset (sub-class) object and father-set (father-class) may be rather difficult to achieve. This is an often-quoted case-- subtype is not equivalent to subclass [Budd 2002]. And