utilize commons beansutils to do copy object

8
Utilize Commons BeansUtils to Do Copy Object Albert Guo [email protected] 1

Upload: guo-albert

Post on 19-May-2015

813 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Utilize Commons BeansUtils to do copy object

1

Utilize Commons BeansUtils to Do Copy ObjectAlbert [email protected]

Page 2: Utilize Commons BeansUtils to do copy object

2

Agenda Scenario Introduction Demo

Page 3: Utilize Commons BeansUtils to do copy object

3

Scenario

As user do insert/update/delete,system should keep track of record’s change history

Insert/update/delete NIGT020

Insert data into NIGU020 as user do any change

NIGT020 NIGU020

Page 4: Utilize Commons BeansUtils to do copy object

4

Commons BeanUtils http://commons.apache.org/beanutils/ Most Java developers are used to

creating Java classes that conform to the JavaBeans naming patterns for property getters and setters. It is natural to then access these methods directly, using calls to the corresponding getXxx and setXxx methods.

Page 5: Utilize Commons BeansUtils to do copy object

5

Commons BeanUtils Example use cases include:

Building scripting languages that interact with the Java object model (such as the Bean Scripting Framework).

Building template language processors for web presentation and similar uses (such as JSP or Velocity).

Building custom tag libraries for JSP and XSP environments (such as Jakarta Taglibs, Struts, Cocoon).

Consuming XML-based configuration resources (such as Ant build scripts, web application deployment descriptors, Tomcat's server.xml file).

Page 6: Utilize Commons BeansUtils to do copy object

6

Commons BeanUtils

Page 7: Utilize Commons BeansUtils to do copy object

7

Demo

Page 8: Utilize Commons BeansUtils to do copy object

8

Demo – cont.