Featherweight Java']Java with dynamic and static overloading

被引:7
|
作者
Bettini, Lorenzo [1 ]
Capecchi, Sara [1 ]
Venneri, Betti [2 ]
机构
[1] Univ Turin, Dipartimento Informat, I-10124 Turin, Italy
[2] Univ Florence, Dipartimento Sistemi & Informat, I-50121 Florence, Italy
关键词
Object-oriented languages; Featherweight [!text type='Java']Java[!/text; Multi-methods; Static overloading; Dynamic overloading; Type system; OBJECT-ORIENTED LANGUAGES; MULTIMETHODS; DISPATCH;
D O I
10.1016/j.scico.2009.01.007
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We propose FMJ (Featherweight Multi Java), an extension of Featherweight Java with encapsulated multi-methods thus providing dynamic overloading. Multi-methods (collections of overloaded methods associated to the same message, whose selection takes place dynamically instead of statically as in standard overloading) are a useful and flexible mechanism which enhances re-usability and separation of responsibilities. However, many mainstream languages, such as, e.g., Java, do not provide it, resorting to only static overloading. The proposed extension is conservative and type safe: both "message-not-understood" and "message-ambiguous" are statically ruled out. Possible ambiguities are checked during type checking only on method invocation expressions, without requiring to inspect all the classes of a program. A static annotation with type information guarantees that in a well-typed program no ambiguity can arise at run-time. This annotation mechanism also permits modeling static overloading in a smooth way. Our core language can be used as the formal basis for an actual implementation of dynamic (and static) overloading in Java-like languages. (C) 2009 Elsevier B.V. All rights reserved.
引用
收藏
页码:261 / 278
页数:18
相关论文
共 50 条
  • [1] Featherweight Wrap Java']Java
    Bettini, Lorenzo
    Capecchi, Sara
    Giachino, Elena
    [J]. APPLIED COMPUTING 2007, VOL 1 AND 2, 2007, : 1094 - +
  • [2] JAVA']JAVA & LAMBDA: A FEATHERWEIGHT STORY
    Bettini, Lorenzo
    Bono, Viviana
    Dezani-Ciancaglini, Mariangiola
    Giannini, Paola
    Venneri, Betti
    [J]. LOGICAL METHODS IN COMPUTER SCIENCE, 2018, 14 (03)
  • [3] Lightweight confinement for Featherweight Java']Java
    Zhao, T
    Palsberg, J
    Vitek, J
    [J]. ACM SIGPLAN NOTICES, 2003, 38 (11) : 135 - 148
  • [4] SFJ: An Implementation of Semantic Featherweight Java']Java
    Usov, Artem
    Dardha, Ornela
    [J]. COORDINATION MODELS AND LANGUAGES, COORDINATION 2020, 2020, 12134 : 153 - 168
  • [5] A Generic Type System for Featherweight Java']Java
    Schoepp, Ulrich
    Xu, Chuangjie
    [J]. PROCEEDINGS OF THE 23RD ACM INTERNATIONAL WORKSHOP ON FORMAL TECHNIQUES FOR JAVA-LIKE PROGRAMS (FTFJP '21), 2021, : 9 - 15
  • [6] Featherweight Java']Java - A minimal core calculus for Java']Java and GJ
    Igarashi, A
    Pierce, B
    Wadler, P
    [J]. ACM SIGPLAN NOTICES, 1999, 34 (10) : 132 - 146
  • [7] Featherweight Java']Java: A minimal core calculus for Java']Java and GJ
    Igarashi, A
    Pierce, BC
    Wadler, P
    [J]. ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2001, 23 (03): : 396 - 450
  • [8] Safe Commits for Transactional Featherweight Java']Java
    Thi Mai Thuong Tran
    Steffen, Martin
    [J]. INTEGRATED FORMAL METHODS, 2010, 6396 : 290 - 304
  • [9] Semantic Types and Approximation for Featherweight Java']Java
    Rowe, Reuben N. S.
    van Bakel, S. J.
    [J]. THEORETICAL COMPUTER SCIENCE, 2014, 517 : 34 - 74
  • [10] Thin locks: Featherweight synchronization for Java']Java
    Bacon, DF
    Konuru, R
    Murthy, C
    Serrano, M
    [J]. ACM SIGPLAN NOTICES, 1998, 33 (05) : 258 - 268