CSC/ECE 517 Summer 2008/wiki1 3 aobk: Difference between revisions
Jump to navigation
Jump to search
(c) |
|||
Line 7: | Line 7: | ||
=== Ruby Reflection Sequences === | === Ruby Reflection Sequences === | ||
=== Java Reflection Sequences === | === Java Reflection Sequences === | ||
Java uses an '''Reflection API''' to inspect and manipulate itself; it includes the expanded ''class'' class in java.lang and the java.lang.reflect package, which represents the members of a class with ''Method'', ''Constructor'' and ''Field'' objects. | |||
=== Ruby Reflection vs. Java Reflection === | === Ruby Reflection vs. Java Reflection === |
Revision as of 13:44, 5 June 2008
Reflection in Ruby and Java
Reflection, in the realm of Computer Science, is the process of introspection by a program. Through the technique of metaprogramming, aspects of a program are examined from within the program itself, which enables the program to modify itself at runtime. By looking at and inside classes and objects, much can be discovered, including the following:
- what objects are contained in a program
- the class hierarchy
- the attributes and methods of the objects contained in the program
- various method information
Ruby Reflection Sequences
Java Reflection Sequences
Java uses an Reflection API to inspect and manipulate itself; it includes the expanded class class in java.lang and the java.lang.reflect package, which represents the members of a class with Method, Constructor and Field objects.