许多程序员会混淆元类和基类的不同。
Many programmers are confused about the difference between a metaclass and a base class.
单单选择同一元类的多项,例如一些属性。
Just select multiple items of the same metaclass, such as several attributes.
每个固定模型的元类扩展有一个或者多个条目。
One or more entries for each metaclass extension of each stereotype.
为C手工创建必需的元类,可以避免元型冲突
The metatype conflict can be avoided by manually creating the needed metaclass for C
它包含许多代理和元类。
类的属性(包括元类和原型的关联)应该选择这个属性。
Properties of class type (including metaclass and stereotype associations) should have this option selected.
元类扩展的EClass的具体子类型将会自动被添加。
Concrete subtypes of the metaclass extension's EClass will automatically be added.
请注意原型仅仅可以被应用到元素下,当它的元类是扩展的。
Please note that the stereotype can be applied only to the elements whose metaclass it extends.
从注释到包,包括类本身,UML中的每个概念都有一个元类。
From comments to packages, including classes themselves, every concept in UML has a metaclass.
元类将创建此类(作为一个新式类)并将其传递给类初始化器过程。
The metaclass will create the class (as a new style one) and will pass it to the class initializer procedure.
应该用一个附加到XO、行为是动态决定的自定义元类来完成上述工作。
You could accomplish the above sort of job with a custom metaclass, attached to XO, but with behavior determined dynamically.
它示范了概要文件的实际细节,并且利用扩展符号展示了带有元类的原型。
It demonstrates the actual details of the profile and shows each stereotype with its metaclass, using the extension notation.
如果不属于这种情形,那就跳过元类,使您(和您的用户)的生活更加惬意。
If this is not your case, skip the metaclass and make your life (and that of your users) happier.
如果在这个配置文件中没有定义图标,这个对应元类扩展的图标就会被使用。
If there is no icon defined in the profile, the icon corresponding to the metaclass extension will be used.
元类被原型所扩展,是在属性视图Extensions 标检页完成的。
The metaclasses being extended by the stereotype are specified on the Extensions tab in the Properties view.
当解析发生时,在查找实例化元类之前,会先遵循它的MRO对类进行查找。
As it turns out, lookup on a class follows its MRO before it looks in its instantiating metaclass.
跟流行的观点相反,这是一个在大多数时候都不需要而且不想要自定义元类的工作。
Contrary to popular belief, this is a job where most of the time you do not need and you do not want a custom metaclass.
现在总结一下,概要文件包含有两个原型,a以及b,它扩展了元类Class。
To summarize, the profile contains two stereotypes, a and B, which extend the metaclass class.
对于您所创建的每一个构造型,您必须对包和其他所有需要的元类扩展添加一个元类。
For every stereotype that you create, you must add a metaclass extension to the package in addition to any other desired metaclass extensions.
除了我们已经看到的例子,expando元类也提供了一些补充的功能。
Beyond those examples we've seen so far, expando meta-classes also provide some complementary hooks. Four other kind of methods can be added to an expando meta-class.
对于未来库版本中的元类,我有几个技巧方面的想法,而且我甚至可能使用特性和插槽。
I have some ideas for doing some tricky stuff with metaclasses in future library versions, and I might even work in properties and slots.
最后,您将为整个产品线开发一个功能模型(以uml元类关系图表示),如图3所示。
Finally, you develop a feature model (expressed in UML metaclass diagrams) for the entire product line, as shown in Figure 3.
如果您选择为它创建工具,就会自动为元类联合和固定模式联合的编辑部分自动产生代码。
Code will be generated automatically for edit parts of metaclass associations and stereotype associations if you choose to create the tooling for it.
分析阶段的产物是一个元类模型,此模型描述候选服务、候选服务的角色构造型及其操作。
The outcome of the analysis phase is a metaclass model that describes candidate services, their role stereotypes, and their operations.
注意到如果这个元类扩展以前是一个抽象的EClass,它将不会显示在这个列表中。
Observe that if the metaclass extension was to an abstract EClass, it will not show in the list.
用户应该理解元类型冲突的原因和解决方案,当您想使用多个定制的元类时,这将非常必要。
Users should understand the cause and the resolution of metatype conflicts. This becomes essential when you want to use more than one custom metaclass.
换句话说,只有当想在派生类上运行代码,又不想让用户注意到时,才应该使用自定义元类。
In other words, you should use a custom metaclass only when your real intention is to have code running on derived classes without users of those classes noticing it.
从好的方面看,继承的 _metaclass_钩子和自定义元类的所有问题都被解决了
On the plus side, all issues for inherited _metaclass_ hooks and for custom metaclasses are handled
属性集概要文件中的构造型类似于需要的构造型,它位于应用到特定元类元素的概要文件之中。
Stereotypes in a property set profile are similar to required stereotypes in that they are implicitly applied to the elements of the specified metaclass.
在本文中,我们希望为避免这种聪明做出小小的贡献,至少在我们比较精通的领域避免元类滥用。
In this article, we hope to make a small contribution away from cleverness, at least in an area where we have some expertise, that being metaclass abuses.
应用推荐