Ownership types for object encapsulation

被引:26
作者
Boyapati, C [1 ]
Liskov, B [1 ]
Shrira, L [1 ]
机构
[1] MIT, Comp Sci Lab, Cambridge, MA 02139 USA
关键词
ownership types; object encapsulation; software upgrades;
D O I
10.1145/640128.604156
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Ownership types provide a statically enforceable way of specifying object encapsulation and enable local reasoning about program correctness in object-oriented languages. However, a type system that enforces strict object encapsulation is too constraining: it does not allow efficient implementation of important constructs like iterators. This paper argues that the right way to solve the problem is to allow objects of classes defined in the same module to have privileged access to each other's representations; we show how to do this for inner classes. This approach allows programmers to express constructs like iterators and yet supports local reasoning about the correctness of the classes, because a class and its inner classes together can be reasoned about as a module. The paper also sketches how we use our variant of ownership types to enable efficient software upgrades in persistent object stores.
引用
收藏
页码:213 / 223
页数:11
相关论文
共 61 条
[1]  
AGESEN O, 1907, OBJECT ORIENTED PROG
[2]  
ALDRICH J, 2002, OBJECT ORIENTED PROG
[3]  
ALMEIDA PS, 1997, EUR C OBJ OR PROGR E
[4]  
[Anonymous], [No title captured]
[5]  
[Anonymous], 1990, PROGRAMMING CONCEPTS
[6]  
ATKINSON MP, 2000, PERSISTENT OBJECT SY
[7]  
ATKINSON MP, 1996, PERSISTENT OBJECT SY
[8]  
BANERJEE A, 2002, PRINCIPLES PROGRAMMI
[9]  
BANERJEE J, 1987, ACM SIGMOD INT C MAN
[10]  
BOKOWSKI B, 1999, OBJECT ORIENTED PROG