ABSTRACT
In the last few years the interest in reflection has grown and many modern programming languages/architectures have provided the programmer with reflective mechanisms. As well as any other novelty also reflection has detractors. They rightly or wrongly accuse reflection to be too inefficient to be used with real profit. In this work, we have investigated about the performance of Java reflection library (especially of the class Method and of its method invoke) and realized a mechanism which improves its performances. Our mechanism consists of a class, named SmartMethod and of a parser contributing to transform reflective invocations into direct call carried out by the standard invocation mechanism of Java. The SmartMethod class is compliant --- that is, it provides exactly the same services ---, with the class Method of the standard Java core reflection library but it provides a more efficient reflective method invocation.
- K. Arnold and J. Gosling. The Java Programming Language. The Java Series ... from the Source. Addison-Wesley, Reading, Massachusetts, second edition, Dec. 1997.]] Google ScholarDigital Library
- W. Cazzola. Remote Method Invocation as a First-Class Citizen. Distributed Computing, 2003. To Appear.]] Google ScholarDigital Library
- W. Cazzola. R. J. Stroud, and F. Tisato, editors. Reflection and Software Engineering, volume 1826 of Lecture Notes in Computer Science. Springer-Verlag, Heidelberg, Germany, June 2000.]]Google Scholar
- S. Chiba. A Meta-Object Protocol for C++. In Proceedings of the 10th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA'95), volume 30 of Sigplan Notices, pages 285--299, Austin, Texas, USA, Oct. 1995. ACM.]] Google ScholarDigital Library
- S. Chiba. Load-Time Structural Reflection in Java. In E. Bertino, editor, Proceedings of the 14th European Conference on Object-Oriented Programming (ECOOP'2000), LNCS 1850, pages 313--336, Cannes, France, June 2000. Springer-Verlag.]] Google ScholarDigital Library
- I. R. Forman and N. B. Forman. Java Reflection. Manning Publications, 2004.]]Google Scholar
- J. Gosling, B. Joy, G. Steele, and G. Bracha. The Java Language Specification. The Java Series ... from the Source. Addison-Wesley, Reading, Massachusetts, second edition, 2000.]] Google ScholarDigital Library
- K. Hoffman, J. Gabriel, D. Gosnell, J. Hasan, C. Holm, E. Musters, J. Narkiewickz, J. Schenken, T. Thangarathinam, S. Wylie, and J. Ortiz. Professional .NET Framework. Wrox Press., 2001.]]Google Scholar
- S. Liang. Java Native Interface: Programmer's Guide and Specification. The Java Series ... from the Source. Addison-Wesley, Reading, Massachusetts, June 1999.]] Google ScholarDigital Library
- P. Maes. Concepts and Experiments in Computational Reflection. In N. K. Meyrowitz, editor, Proceedings of the 2nd Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA'87), volume 22 of Sigplan Notices, pages 147--156, Orlando, Florida, USA, Oct. 1987. ACM.]] Google ScholarDigital Library
- H. Masuhara and A. Yonezawa. Design and Partial Evaluation of Meta-objects for a Concurrent Reflective Language. In E. Jul, editor, Proceedings of the 12th European Conference on Object-Oriented Programming (ECOOP'98), LNCS 1445, pages 418--439. Springer-Verlag, July 1998.]] Google ScholarDigital Library
- Microsoft Corporation. .NET Framework Developer's Guide: Reflection Overview. Technical report, Microsoft Developer Network (MSDN), 2003. http: //msdn.microsoft.com/library/default.asp?url= /library/en-us/cpguid%e/html/cpconreflectionoverview.asp.]]Google Scholar
- SUN Microsystems. Java#8482; Core Reflection API and Specification. Technical report, SUN Microsystems, Feb. 1997.]]Google Scholar
- SUN Microsystems. Java#8482; Remote Method Invocation - Distributed Computing for Java. White paper, SUN Microsystems, 1998. Internet Publication - http://www.sun.com.]]Google Scholar
- A. Yonezawa and S. Matsuoka, editors. Proceedings of 3rd International Conference on Metalevel Architectures and Separation of Crosscutting Concerns (Reflection'2001), volume 2192 of Lecture Notes in Computer Science. Springer-Verlag, Heidelberg, Germany, Sept. 2001.]] Google ScholarDigital Library
- SmartMethod: an efficient replacement for method
Recommendations
jLab: Integrating a scripting interpreter with Java technology for flexible and efficient scientific computation
The jLab environment extends the potential of Java for scientific computing. It provides a Matlab/Scilab like scripting language that is executed by an interpreter implemented in the Java language. The scripting language supports the basic programming ...
Evaluating the Java Native Interface JNI: Leveraging Existing Native Code, Libraries and Threads to a Running Java Virtual Machine
This article aims to explore JNI features and to discover fundamental operations of the Java programming language, such as arrays, objects, classes, threads and exception handling, and to illustrate these by using various algorithms and code samples. ...
An efficient native function interface for Java
PPPJ '13: Proceedings of the 2013 International Conference on Principles and Practices of Programming on the Java Platform: Virtual Machines, Languages, and ToolsWe present an efficient and dynamic approach for calling native functions from within Java. Traditionally, programmers use the Java Native Interface (JNI) to call such functions. This paper introduces a new mechanism which we tailored specifically ...
Comments