Java framework programming (3)-fragment about reflection

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.