Object-oriented encapsulation for dynamically typed languages

被引:8
|
作者
Schärli, N
Black, AP
Ducasse, S
机构
[1] Univ Bern, Software Composit Grp, Bern, Switzerland
[2] Oregon Hlth & Sci Univ, OGI Sch Sci & Engn, Portland, OR 97201 USA
关键词
dynamic typing; encapsulation; encapsulation policies; information hiding; smalltalk;
D O I
10.1145/1035292.1028988
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Encapsulation in object-oriented languages has traditionally been based on static type systems. As a consequence; dynamically-typed languages have only limited support for encapsulation. This is surprising, considering that encapsulation is one of the most fundamental and important concepts behind object-oriented programming and that it is essential for writing programs that are maintainable and reliable, and that remain robust as they evolve. In this paper we describe the problems that are caused by insufficient encapsulation mechanisms and then present object-oriented encapsulation, a simple and uniform approach that solves these problems by bringing state of the art encapsulation features to dynamically typed languages. We provide a detailed discussion of our design rationales and compare them and their consequences to the encapsulation approaches used for statically typed languages. We also describe an implementation of object-oriented encapsulation in Smalltalk. Benchmarks of this implementation show that extensive use of object-oriented encapsulation results in a slowdown of less than 15 percent.
引用
收藏
页码:130 / 149
页数:20
相关论文
共 50 条
  • [31] ITERATIVE TYPE ANALYSIS AND EXTENDED MESSAGE SPLITTING - OPTIMIZING DYNAMICALLY-TYPED OBJECT-ORIENTED PROGRAMS
    CHAMBERS, C
    UNGAR, D
    SIGPLAN NOTICES, 1990, 25 (06): : 150 - 164
  • [32] EVALUATING OBJECT-ORIENTED QUERY LANGUAGES
    CHAN, DKC
    TRINDER, PW
    WELLAND, RC
    COMPUTER JOURNAL, 1994, 37 (10): : 858 - 872
  • [33] Classes and modules in object-oriented languages
    Barron-Estrada, ML
    Stansifer, R
    Zatarain-Cabada, R
    8TH WORLD MULTI-CONFERENCE ON SYSTEMICS, CYBERNETICS AND INFORMATICS, VOL IX, PROCEEDINGS: COMPUTER SCIENCE AND ENGINEERING: I, 2004, : 138 - 143
  • [34] A survey of concurrent object-oriented languages
    Philippsen, M
    CONCURRENCY-PRACTICE AND EXPERIENCE, 2000, 12 (10): : 917 - 980
  • [35] Evaluating object-oriented query languages
    Chan, Daniel K.C., 1600, Oxford Univ Press, Oxford (37):
  • [36] Orthogonal persistence and object-oriented languages
    Lew, KCF
    Brown, AL
    PROCEEDINGS OF THE 21ST AUSTRALASIAN COMPUTER SCIENCE CONFERENCE, ACSC'98, 1998, 20 (01): : 333 - 344
  • [37] Workshop on Foundations of Object-Oriented Languages
    Bruce, KB
    INFORMATION AND COMPUTATION, 2002, 175 (01) : 1 - 2
  • [38] Session types for object-oriented languages
    Dezani-Ciancaglini, Mariangiola
    Mostrous, Dimitris
    Yoshida, Nobuko
    Drossopoulou, Sophia
    ECOOP 2006 - OBJECT-ORIENTED PROGRAMMING, PROCEEDINGS, 2006, 4067 : 328 - 352
  • [39] Object-oriented languages and tools proliferate
    不详
    COMPUTER DESIGN, 1996, 35 (10): : 96 - 96
  • [40] CONCURRENCY POSSIBILITIES IN OBJECT-ORIENTED LANGUAGES
    LELCHUK, TI
    PROGRAMMING AND COMPUTER SOFTWARE, 1990, 16 (06) : 246 - 255