Article ID Journal Published Year Pages File Type
417478 Computer Languages, Systems & Structures 2007 19 Pages PDF
Abstract

Message dispatch in object-oriented programming (OOP) involves target method lookup in dispatch table/tree. Reflective environment builds dispatch data-structure at runtime as types can be added at runtime. Hence, algorithms for reflective environments require dynamic data structure for dispatch. In this paper, we propose a tree-based algorithm for multiple dispatch in reflective runtime environment. New classes can be added to the system at runtime. Proposed algorithm performs lookup in time proportional to log(n)log(n) times the polymorphic arguments, where n is number of classes in a system. Proposed algorithm uses type-safe approach for multimethod lookup resolving ambiguities. We compare performance of the proposed algorithm with the dispatch mechanism in commonly used virtual/reflexive systems, e.g., Java and Microsoft's Common Language Runtime (MS-CLR), in respect of efficiency and type-safety.

Related Topics
Physical Sciences and Engineering Computer Science Computational Theory and Mathematics
Authors
, ,