首页> 外文期刊>Computer Languages, Systems & Structures >Uniform and safe metaclass composition
【24h】

Uniform and safe metaclass composition

机译:统一且安全的元类组成

获取原文
获取原文并翻译 | 示例

摘要

In pure object-oriented languages, classes are objects, instances of other classes called metaclasses. In the same way as classes define the properties of their instances, metaclasses define the properties of classes. It is therefore very natural to wish to reuse class properties, utilizing them amongst several classes. However this introduced metaclass composition problems, i.e., code fragments applied to one class may break when used on another class due to the inheritance relationship between their respective metaclasses. Numerous approaches have tried to solve metaclass composition problems, but they always resort to an ad-hoc manner of handling conflicting properties, alienating the meta-programmer. We propose a uniform approach that represents class properties as traits, groups of methods that act as a unit of reuse from which classes are composed. Like all the other classes in the system, metaclasses are composed out of traits. This solution supports the reuse of class properties, and their safe and automatic composition based on explicit conflict resolution. The paper discusses traits and our solution, shows concrete examples implemented in the Smalltalk environment Squeak, and compares our approach with existing models for composing class properties.
机译:在纯面向对象的语言中,类是对象,即称为类的其他类的实例。与类定义实例属性的方式相同,元类定义类的属性。因此,很自然地希望在几个类之间重用类属性。但是,这种引入的元类组成问题,即应用于一个类的代码片段由于在它们各自的元类之间的继承关系而在另一类上使用时可能会中断。许多方法试图解决元类组成问题,但是它们始终采用临时的方式来处理冲突的属性,从而使元编程器疏远了。我们提出了一种统一的方法,该方法将类属性表示为特征,这是作为组成类的重用单元的方法组。像系统中的所有其他类一样,元类由特征组成。该解决方案支持类属性的重用,以及基于显式冲突解决方案的安全,自动组合。本文讨论了特质和我们的解决方案,展示了在Smalltalk环境Squeak中实现的具体示例,并将我们的方法与现有的组成类属性的模型进行了比较。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号