【24h】

Masked types for sound object initialization

机译:声音对象初始化的遮罩类型

获取原文

摘要

This paper presents a type-based solution to the long-standing problem of object initialization. Constructors, the conventional mechanism for object initialization, have semantics that are surprising to programmers and that lead to bugs. They also contribute to the problem of null-pointer exceptions, which make software less reliable. Masked types are a new type-state mechanism that explicitly tracks the initialization state of objects and prevents reading from uninitialized fields. In the resulting language, constructors are ordinary methods that operate on uninitialized objects, and no special default value (null) is needed in the language. Initialization of cyclic data structures is achieved with the use of conditionally masked types. Masked types are modular and compatible with data abstraction. The type system is presented in a simplified object calculus and is proved to soundly prevent reading from uninitialized fields. Masked types have been implemented as an extension to Java, in whichcompilation simply erases extra type information. Experience using the extended language suggests that masked types work well on real code.
机译:本文针对长期存在的对象初始化问题提出了一种基于类型的解决方案。构造函数是对象初始化的常规机制,其语义使程序员感到惊讶,并导致错误。它们还会导致空指针异常的问题,这会使软件的可靠性降低。掩码类型是一种新的类型状态机制,该机制可显式跟踪对象的初始化状态,并防止从未初始化的字段进行读取。在结果语言中,构造函数是对未初始化的对象进行操作的普通方法,并且该语言不需要特殊的默认值(空)。循环数据结构的初始化是通过使用条件屏蔽类型来实现的。屏蔽类型是模块化的,并且与数据抽象兼容。该类型系统以简化的对象演算形式呈现,并被证明可以有效防止未初始化字段的读取。屏蔽类型已实现为Java的扩展,其中,编译只是删除了多余的类型信息。使用扩展语言的经验表明,掩码类型可以在实际代码上很好地工作。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号