CSC/ECE 517 Fall 2009/wiki2 5 jdf
Please note that this is still work in progress - Not Yet Ready for Review
Reflection is widely used in programming languages. This topic is not about reflection per se, but about reflection APIs--the facilities that particular languages provide for doing reflection. Is reflection "built in" to some o-o languages, while others require external libraries to perform reflection? What built-in and library functions are provided? Which APIs are easiest to use and why?
Reflection APIs
Introduction
Reflection is a feature offered by many modern programming languages. Reflection provides programmers with the ability to write code that determines information about a set of code during run time. The information that is acquired through reflection can be used to develop very sophisticated program features. Programs can be written to adapt based on the characteristics of the code itself. The information that can be obtained via reflection includes elements such as:
- The class types of objects that are present in the running program
- The class hierarchy of an object or set of objects
- The attributes and methods of objects
- Details of the method calls supported by objects [1]
Reflection is present in many languages and its use is particularly prevalent in Object Oriented languages, such as Java and Ruby. The level of implementation and ease of use varies among languages. The objective of this article is to provide an overview of the Application Programming Interfaces or APIs that exist in various Object Oriented Languages to provide reflection functionality.
Languages that Provide a Reflection API
- Microsoft .NET, includes C#, C++, and VB.NET
- Java
- Ruby, built in
- Smalltalk-80
Resources
References
[1] Thomas, D., Fowler C. and Hunt A. Programming Ruby, The Pragmatic Programmer's Guide. 2nd Edition. The Pragmatic Bookshelf.
CSC 517 Fall 2009
Wiki 2 Assignment
Author: Newwolf