2013 | OriginalPaper | Buchkapitel
Achieving Multiple Dispatch in Hybrid Statically and Dynamically Typed Languages
verfasst von : Francisco Ortin, Miguel Garcia, Jose M. Redondo, Jose Quiroga
Erschienen in: Advances in Information Systems and Technologies
Verlag: Springer Berlin Heidelberg
Aktivieren Sie unsere intelligente Suche um passende Fachinhalte oder Patente zu finden.
Wählen Sie Textabschnitte aus um mit Künstlicher Intelligenz passenden Patente zu finden. powered by
Markieren Sie Textabschnitte, um KI-gestützt weitere passende Inhalte zu finden. powered by
Multiple dispatch is a feature provided by some programming languages, in which the actual method to be executed is dynamically determined by the runtime types of its arguments. Although some programming languages such as CLOS, Xtend and Dylan provide this feature, many widespread languages such as Java, C# and C++ only support
single
dispatch by means of dynamic binding. Therefore, different implementation techniques are commonly used to obtain multiple dispatch from within these single-dispatch languages. We propose a new approach to obtain multiple dispatch in single-dispatch hybrid static and dynamic typing languages. Using C# as an example, the proposed approach is compared with the existing ones, considering factors such as software maintainability and readability, code size, parameter generalization, compile-time type checking, and runtime performance. The example implementation of the hybrid statically and dynamically typed approach in
.Net
has shown a runtime performance 1.26 times lower than the statically typed approach, and 6.27 times higher than the dynamically type one.