CSC/ECE 517 Fall 2007/ch1 1c JF: Difference between revisions
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
[http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] allows programs to act in a more "intelligent" way by providing programs the ability to answer questions about what they do and modify behavior based on those answers. These features can be classified as introspection and intercession [3]. Introspection is what allows an object or class to answer questions about itself. Intercession is what allows an object or class to change behavior based on the answers to those questions. | [http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection] allows programs to act in a more "intelligent" way by providing programs the ability to answer questions about what they do and modify behavior based on those answers. These features can be classified as introspection and intercession [3]. Introspection is what allows an object or class to answer questions about itself. Intercession is what allows an object or class to change behavior based on the answers to those questions. | ||
Languages can implement reflection by either being an inherently reflective language, like Ruby, or by including a package that allows reflection, like Java. The | Languages can implement reflection by either being an inherently reflective language, like Ruby, or by including a package that allows reflection, like Java. The implementation is different. | ||
== Introspection == | == Introspection == | ||
Reflective langauges can answer questions about themselves and their methods. | Reflective langauges can answer questions about themselves and their methods. | ||
=== Reflective Language Examples === | === Reflective Language Examples === |
Revision as of 17:39, 6 September 2010
Features of Reflection
Reflection allows programs to act in a more "intelligent" way by providing programs the ability to answer questions about what they do and modify behavior based on those answers. These features can be classified as introspection and intercession [3]. Introspection is what allows an object or class to answer questions about itself. Intercession is what allows an object or class to change behavior based on the answers to those questions.
Languages can implement reflection by either being an inherently reflective language, like Ruby, or by including a package that allows reflection, like Java. The implementation is different.
Introspection
Reflective langauges can answer questions about themselves and their methods.
Reflective Language Examples
Ruby
Reflective Package Examples
Java
Feature 2
Reflective Language Examples
Reflective Package Examples
References
[1] Reflection-Oriented Programming
[2] Procedural Reflection in Programming Languages
[3] Evolving a Reflective Language Lessons Learned from Implementing Traits