Author: Jiangnan Baiyi
Reflection: all textbooks have been mentioned. Here we can only talk about it with ease.
Reflection is a technology that allows the framework to call object attributes and functions based on "information in the form of strings, it is one of Java's greatest advances in C ++-making framework programming more common. In the time of MFC, no matter how deep Hou Jie was, I was not familiar with the magic macros that registered "message-function ing.
However, Java reflection is proud of C ++, because C #, Ruby, Python, and even PHP are standard reflection functions. In addition, the reflection syntax is embedded in the basic object class. Let's look at the weakest PHP:
$ Func_name = "helloworld ";
$ Foo-> $ func_name;
Java, however, has produced a bunch of classes such as class, methed, field, and constructor. Originally, this is a very rigorous Java designer and cool embodiment. The problem is that it does not provide a simple integrated writing ...... the same situation also occurs in the Java I/O class library.
Microsoft is doing better in this respect and understands how to favor developers.
Because of the relentless nature of Java, we need to make our own beanutils projects. Thanks to Apache Jakarta commons, you can use it directly.
In addition, spring has also made one.
You can also use eMule to copy the <relection in action>.
For the reflection in C ++, see my idol di article. Another bt c ++ framework called acdk is similar to Java, including reflection and garbage collection, and even threads similar to jsdk, Unicode, I/O, network, xml api. Unfortunately, even with C ++ 0x, Uncle B is not prepared to support reflection at the language level.
Series of articles:
Java framework writing (1) -- Preface
Java framework programming (2)-boring usage of generics and platforms for wiping Methods
Java framework programming (3) -- fragment about reflection
Java framework programming (4) -- Annotation vs XML vs interface the latest round
Java framework programming (5) -- cglib Application
Framework programming in Java (6) -- ASM (to be written)