No bushshit. Blogging ~~

Monday, February 14, 2005

Apache BeanUtils Commons

While going through the custom tags of my company handled frameworks,
I knew I have to study a series of open source projects of Apache group.
One of them is BeanUtils Commons.
To say it in simple, it is a technique which allow dynamically handle
the setter / getter of JavaBean. It is not required to instantiate the class
and called its setter method but we can construct a string of the name of requested attribute,
(which may inside a map, a list or just simple attribute itself) and called it directly through a BeanUtils method.

The benefit is that I can set/get the attribute based on a logic process in RUNTIME. All thanks to the reflection advantage of JAVA language and allow much flexibility in programming.

More than that, I can use the BeanUtils method to invoke the method of an object (invokeMethod) or copy the attribute from one object to another (copyProperty) which usually occurs between data object and Struts form.

Some authors suggest the use of DynaForm or (DynaBean, DynaBeanClass) and I think I need to study it much later.

http://jakarta.apache.org/commons/beanutils/
http://blog.csdn.net/calvinxiu/archive/2005/02/02/277748.aspx
http://www.javaworld.com.tw/jute/post/view?bid=12&id=842&sty=1&tpg=2&age=0
http://yhe.dalian.cn/showlog.jspe?log_id=105








Just find that some of the apache project is worth to study

0 Comments:

Post a Comment

<< Home