作业帮 > 英语 > 作业

英语翻译Often in the program you will refer to an e-mail object

来源:学生作业帮 编辑:作业帮 分类:英语作业 时间:2024/05/16 19:38:00
英语翻译
Often in the program you will refer to an e-mail object as if it was the parent (super-class)
because it will not matter whether the e-mail contains a picture,or sound,or just text.This code
will not need to be altered when you add another sub-class of e-mail objects,containing (say)
electronic cash..
Sometimes you may want an action on a super-class to produce a result that depends on
what sub-class it "really is".For example,you may want to display a list of email objects and
want each sub-class (text,image,etc) to display in a different colour.In many languages it is
possible for the super-class to have functions that sub-classes change to suit their own purposes
(polymorphism,implemented by the compiler using a technique called dynamic binding).So each email sub-class may supply an alternative to the default,printing function,with its own colour.
In many OO languages it is possible to find out what class an object is (run time type
information) and even what functions are connected with it (introspection / reflection).Others,
like C++ have little run time information available (at least in the standard languageindividual
libraries of objects can support RTTI with their own conventions).
There are at least three approaches to OO languages:Methods in Classes,Multi-Methods
Separate from Classes,Prototypes.
Often in the program you will refer to an e-mail object as if it was the parent (super-class)\x05
经常在节目,你会指电子邮件对象好像这是家长(买)\x05
because it will not matter whether the e-mail contains a picture,or sound,or just text.\x05
因为它将不论电子邮件包含一个图像和声音,或者只是文本.\x05
This code\x05
这个代码\x05
will not need to be altered when you add another sub-class of e-mail objects,containing (say)\x05
不需要改变sub-class当你增加另一个物体的电子邮件,包含(说)\x05
electronic cash..\x05
电子现金.\x05
Sometimes you may want an action on a super-class to produce a result that depends on\x05
有时你可能想要一个行动来产生一个结果,买取决于\x05
what sub-class it "really is".\x05
什么sub-class”真的是”.\x05
For example,you may want to display a list of email objects and\x05
例如,你可能想要显示一个列出的电子邮件对象和\x05
want each sub-class (text,image,etc) to display in a different colour.\x05
要标注(如文本、图像等)来显示不同的颜色.\x05
In many languages it is\x05
在许多语言\x05
possible for the super-class to have functions that sub-classes change to suit their own purposes\x05
有可能买功能改变以适应面向他们自己的目的\x05
(polymorphism,implemented by the compiler using a technique called dynamic binding).\x05
(多态性,实现由编译器使用一种叫动态绑定).\x05
So each email sub-class may supply an alternative to the default,printing function,with its own colour.\x05
所以每个电子邮件sub-class还可以提供另一个默认的,打印功能,都有它自己的颜色.\x05
In many OO languages it is possible to find out what class an object is (run time type\x05
在许多面向对象语言,就有可能发现了一个对象是哪班(运行时类型\x05
information) and even what functions are connected with it (introspection / reflection).\x05
信息),甚至连有哪些功能(反省/反射).\x05
Others,\x05
别人,\x05
like C++ have little run time information available (at least in the standard languageindividual\x05
像c++没有运行时间信息(至少在标准languageindividual\x05
libraries of objects can support RTTI with their own conventions).\x05
图书馆的对象可以支持用他们自己的习俗RTTI).\x05
There are at least three approaches to OO languages:Methods in Classes,Multi-Methods\x05
至少有三个面向对象语言的方法:方法在班,多管齐下\x05
Separate from Classes,Prototypes.\x05
独立于课程,原型.