CSC/ECE 517 Fall 2009/wiki2pthelm

From Expertiza_Wiki
Revision as of 00:46, 6 October 2009 by Discostu (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Reflection-Oriented Programming

Reflection-Oriented Programming (ROP) is defined as a programming model design with the intent to analyze and improve it's structure, performance or other implementation aspects during runtime, as opposed to compile time. Two key concepts of ROP are meta-information, which is the state of the program at execution time, and metaprogramming, which is the idea that a language can act as it's own reflection. In other words, a language can reflect (modify) itself.

Reflection vs. ROP

Reflection is the process by which a computer program can observe and modify it's own structure and behavior[1]. It allows an executing program to examine or "introspect" upon itself, and manipulate internal properties of the program[2]. Java, Ruby and .NET are among the most popular reflective languages, however there are many others[3]. Although reflection is the primary concept behind ROP, it does not necessarily preclude the existence of ROP. ROP is a concept of design; as with most designs, it is not necessarily dependent on the implementation. Computational programming can also be used, and does not assume the presence of source code at runtime, something that is essential to the concept of reflection[4].

Meta-Information

Meta-Information is the state of the program at execution time.

Metaprogramming

Metaprogramming introduces the concept of "programs that write programs". Reflection is one type of metaprogramming, and therefore can be considered as an option when attempting to design based on ROP.

Examples

Rather than show examples of reflection,


References

[1] Reflection (Computer Science), Wikipedia: http://en.wikipedia.org/wiki/Reflection_%28computer_science%29 [2] Using Java Reflection, Sun: http://java.sun.com/developer/technicalArticles/ALT/Reflection/ [3] List of reflective programming languages and platforms, Wikipedia: http://en.wikipedia.org/wiki/List_of_reflective_programming_languages_and_platforms [4] An Introduction to Reflection-Oriented Programming, Sobel & Friedman: http://www2.parc.com/csl/groups/sda/projects/reflection96/docs/sobel/sobel.pdf