metaclass
n. 元类
2026-03-21 19:57 浏览次数 12
n. 元类
Metaclass mechanism元类机制
metaclass programming元类程序设计
metaclass object元类对象
root metaclass根元类
metaclass-based基于元类
Improved Select metaclass dialog (for creating metaclass extensions).
改进的选择元类对话框(为创建元类扩展标记)。
For example, suppose that there is a stereotype s, which extends the metaclass Actor and has an attribute named attr1.
例如,假设存在一个原型s,它扩展了元类Actor并且有一个命名叫attr1的属性。
Observe that if the metaclass extension was to an abstract EClass, it will not show in the list.
注意到如果这个元类扩展以前是一个抽象的EClass,它将不会显示在这个列表中。
As well as being a class, Duke is an instance of the metaclass Nobility — attribute lookup proceeds as with any object.
Duke是一个类,也是元类Nobility的一个实例——属性的查找过程与其他对象一致。
To summarize, the profile contains two stereotypes, a and B, which extend the metaclass class.
现在总结一下,概要文件包含有两个原型,a以及b,它扩展了元类Class。
As mentioned in the last section, decorators could not completely replace the metaclass hook since they only modify methods rather than add or delete methods.
正如上一节中介绍的一样,decorator并不能完全取代元类挂钩,因为它们只修改了方法,而未添加或删除方法。
The metaclass will create the class (as a new style one) and will pass it to the class initializer procedure.
元类将创建此类(作为一个新式类)并将其传递给类初始化器过程。
Users must understand the differences and interactions between metaclass programming and traditional object-oriented programming (under both single and multiple inheritance).
用户必须理解元类编程和传统面向对象编程的不同点和相同点(单继承和多继承)。
If you generate a metaclass association or a stereotype association, you need to generate the tooling or shape for the stereotyped ends.
如果您产生了一个元类联合或者一个固定模型联合,您需要为这个固定模式终端产生工具或者形状。
If this is not your case, skip the metaclass and make your life (and that of your users) happier.
如果不属于这种情形,那就跳过元类,使您(和您的用户)的生活更加惬意。
Please note that the stereotype can be applied only to the elements whose metaclass it extends.
请注意原型仅仅可以被应用到元素下,当它的元类是扩展的。
The next installment in this series will cover more advanced topics, such as metaclass syntax, ABCs, decorators, integer literal support, base types, and exceptions.
本系列的下一期文章将会涵盖更高级的主题,比如元类语法、a BC、修饰符、integerliteral支持、基类型和异常。
Many programmers are confused about the difference between a metaclass and a base class.
许多程序员会混淆元类和基类的不同。
The availability of metaclass attributes is not transitive; in other words, the attributes of a metaclass are available to its instances, but not to the instances of the instances.
元类属性的可用性是不会传递的,也就是说,元类的属性是对它的实例是可用的,但是对它的实例的实例是不可用的。
You might add a check in the metaclass code to see if the attributes were already set in a parent class, but this adds plumbing and it does not give real control on a per-class basis.
也许会在元类代码中添加一个检查,以查看是否在父类中设置了这些属性,但是这样会增加负担,并且不会控制所有的类。
If there is no icon defined in the profile, the icon corresponding to the metaclass extension will be used.
如果在这个配置文件中没有定义图标,这个对应元类扩展的图标就会被使用。
The default value of an attribute typed as a metaclass reference is null or empty collection (when the multiplicity is greater than 1).
一个元类参考的属性类型的缺省值是null或空集合(当多样性参数大于1)。
Code will be generated automatically for edit parts of metaclass associations and stereotype associations if you choose to create the tooling for it.
如果您选择为它创建工具,就会自动为元类联合和固定模式联合的编辑部分自动产生代码。
Finally, you develop a feature model (expressed in UML metaclass diagrams) for the entire product line, as shown in Figure 3.
最后,您将为整个产品线开发一个功能模型(以uml元类关系图表示),如图3所示。
Properties of class type (including metaclass and stereotype associations) should have this option selected.
类的属性(包括元类和原型的关联)应该选择这个属性。