【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.
机译:本文介绍了基于类型的对象初始化的长期问题的解决方案。构造函数,对象初始化的传统机制具有对程序员令人惊讶的语义,导致错误。它们也有助于零指针异常的问题,使软件不那么可靠。屏蔽类型是一种新型状态机制,明确地跟踪对象的初始化状态,并防止从未初始化的字段读取。在生成的语言中,构造函数是在未初始化对象上运行的普通方法,语言中不需要特殊的默认值(null)。使用条件屏蔽类型实现循环数据结构的初始化。屏蔽类型是模块化的,与数据抽象兼容。类型系统以简化的对象微积分呈现,并证明了解从未初始化的字段读取读取。屏蔽类型已被实现为Java的扩展,在其中遍及删除额外类型的信息。使用扩展语言的经验表明屏蔽类型在实际代码上运行良好。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号