Associated types and constraint propagation for mainstream object-oriented generics

被引:7
作者
Järvi, J
Willcock, J
Lumsdaine, A
机构
[1] Texas A&M Univ, College Stn, TX 77843 USA
[2] Indiana Univ, Open Syst Lab, Bloomington, IN 47405 USA
关键词
languages; generics; generic programming; constraint propagation; associated types; C#; !text type='Java']Java[!/text;
D O I
10.1145/1103845.1094813
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Support for object-oriented programming has become an integral part of mainstream languages, and more recently generic programming has gained widespread acceptance as well. A natural question is how these two paradigms, and their underlying language mechanisms, should interact. One particular design option, that of using subtyping to constrain the type parameters of generic functions, has been chosen in the generics of Java and those planned for a future revision of C#. Certain shortcomings have previously been identified in using subtyping for constraining paranietric polymorphism in the context of generic programming. To address these, we propose extending object-oriented interfaces and subtyping to include associated types and constraint propagation. Associated types are type members of interfaces and classes. Constraint propagation allows certain constraints on type parameters to be inferred from other constraints on those parameters and their use in base class type expressions. The paper demonstrates these extensions in the context of C# (with generics), describes a, translation of the extended features to C#, and presents a formalism proving their safety. The formalism is applicable to other mainstream object-oriented languages supporting F-bounded polymorphism, such as Java.
引用
收藏
页码:1 / 19
页数:19
相关论文
共 50 条
  • [21] AN OBJECT-ORIENTED APPROACH TO THE IMPLEMENTATION OF OSI MANAGEMENT
    DERI, L
    MATTEI, E
    COMPUTER NETWORKS AND ISDN SYSTEMS, 1995, 27 (09): : 1367 - 1385
  • [22] Inferable Object-Oriented Typed Assembly Language
    Tate, Ross
    Chen, Juan
    Hawblitzel, Chris
    ACM SIGPLAN NOTICES, 2010, 45 (06) : 424 - 435
  • [23] A STEP/EXPRESS to object-oriented database translator
    Goh, A
    Hui, SC
    Song, B
    FOURTH INTERNATIONAL CONFERENCE ON COMPUTER-AIDED DESIGN AND COMPUTER GRAPHICS, 1996, 2644 : 530 - 537
  • [24] PARALLEL OBJECT-ORIENTED PROGRAMMING WITH QPC++
    BOLES, D
    STRUCTURED PROGRAMMING, 1993, 14 (04): : 158 - 172
  • [25] OBJECT-ORIENTED PROGRAMMING ENVIRONMENTS - REQUIREMENTS AND APPROACHES
    BISCHOFBERGER, WR
    KOFLER, T
    SCHAFFER, B
    SOFTWARE-CONCEPTS AND TOOLS, 1994, 15 (02) : 49 - 60
  • [26] Scandinavian Contributions to Object-Oriented Modeling Languages
    Moller-Pedersen, Birger
    HISTORY OF NORDIC COMPUTING 3, 2011, 350 : 339 - 349
  • [27] Flexible multibody dynamics - An object-oriented approach
    Anantharaman, M
    NONLINEAR DYNAMICS, 1996, 9 (1-2) : 205 - 221
  • [28] Unifying Aspect- and Object-Oriented Design
    Rajan, Hridesh
    Sullivan, Kevin J.
    ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2009, 19 (01) : 1 - 41
  • [29] A logic for information flow in object-oriented programs
    Amtoft, T
    Bandhakavi, S
    Banerjee, A
    ACM SIGPLAN NOTICES, 2006, 41 (01) : 91 - 102
  • [30] Object-oriented design of a cotton crop model
    Lemmon, H
    Chuk, N
    ECOLOGICAL MODELLING, 1997, 94 (01) : 45 - 51