特别要注意,脚本语言的新类派生存在一定的问题,对使用其可完成的具体任务进行了一定的限制。
In particular, new class derivation is a bit problematic for scripting languages, placing certain restrictions on the exact things you can do with them.
派生类的大小等于基类加上派生实例定义的其他成员(以及对齐所必需的任何额外空间 — 如前所述)的大小。
The size of a derived class is the size of the base class plus the additional members defined by a derived instance (and any extra space required for alignment, as discussed earlier).
新的派生类应该能够替换基础类而无需修改代码。
The new derived classes should be able to replace the base classes without any change in the code.
应用推荐