This article presents a new open source tool (jpa2web) which generates
J2EE Ajax-based Web applications from JPA-annotated beans. Using the
ZK framework, the applications generated by this tool allow your users
to add, delete, search, modify, and interconnect instances of
database-synchronized objects in a friendly, Ajax-based Web user
interface. ZK is an open source, Ajax Web framework used to create a
rich user interface for Web applications, with little programming and
no JavaScript code necessary. With ZK, you can design Web applications
much as if they were desktop applications. ZK takes care of the client
and server Ajax processing. All that needs to be done is to specify
the user interface by creating simple XML files (called zul files) and
scripting the event handlers in the language of choice: Java code
(compiled), Bean Shell (interpreted Java), Groovy, Ruby, JavaScript,
and some others. Readily available tools have dramatically reduced
the impedance created between Java objects and their database storage;
specially, the ease with which Java classes can now be annotated to
specify the way objects should be persisted. Developers are freed from
the onerous task of writing up database integration codes. Hibernate
solves the persistence issue; however, Web pages need to be created to
handle these elements. A typical scenario for a medium-sized Web
application can proceed something like this: The developer starts by
coding the Plain Old Java Objects (POJOs) that represent a particular
domain model, and then proceeds to create the different transactions
and the Web user interface. A subset of the elements of the model will
frequently involve non-transactional data. Customers, clients,
countries, locations, employees, and companies are typical elements
of a business model that are maintained by a few operators. Why not
ted beans? And why not make this presentation a friendly Ajax experience?
Regardless of its limitations, jpa2web is a useful tool in many
scenarios. You can use it to quickly generate the Web interfaces for
non-transactional elements just by having the annotated beans. You can
also use it for testing by creating the necessary instances of objects
in a database, thus avoiding verbose entity creation scripts.
No comments:
Post a Comment