ZK Web Framework 6.0 Released: New Data Binding System

Potix, the company behind ZK has recently released version 6.0 of the Java based Ajax Web Application framework. ZK is an open source Java framework that allows developers to write rich internet applications based on Ajax without writing any JavaScript. Apart from example demos, the official web page also lists several real world applications that use ZK.

In a similar manner to the Google Web Toolkit, ZK abstracts all JavaScript and HTML focusing only on server side Java code for business logic. It achieves this by implementing a server side event engine and a JavaScript one on the client (the Web Browser). This way syncing between server data and client side presentation is completely automated. Programmers can write a complete application using the familiar Event Model of desktop frameworks such as Swing.

Changes included in this new version include:

New "ZK bind" system following the MVVM pattern

jQuery/CSS 3 style selectors that run on server side

Upgrade from jQuery 1.4.x to 1.6.x (performance improvements)

Advanced templates

ZK Comet support for Servlet 3 Asynchronous Processing

New components (and deprecation of old ones)

Upgrade to Java 5

New default theme selection

The most important change is the new data binding system. ZK follows the Model View ViewModel pattern (MVVM), where the ViewModel layer is responsible for converting values from the Model to the View and updating them back when they are changed by the user. The graphical user interface is declared in a markup language completely separated by the data contained in the Model. In ZK the markup used is called ZK User Interface Markup Language (ZUML), while the actual business logic resides in Java code. The main principle here is that ZUML can be edited by non-programmers, allowing for parallel development of UI and Java code resulting in increased productivity. This pattern is not exclusive to ZK, other known examples include XUL from Mozilla and XAML from Microsoft. ZK also supports creating GUIs programmatically completely in Java via ZK Richlets.

"ZK bind" now accepts EL 2.2 expressions allowing for configurable data transfer (one way or two way) between ZUML graphic components and server side Java Objects. The ability to bind on CDI, Seam or Spring beans is directly supported. With the upgrade to Java 5 the use of generics and type safety is also available on the server code. Notice also that the old binding system from ZK 5 is still supported for those who need it, or do not want to upgrade right away.

Another new feature is the introduction of jQuery style selectors for server side Java code. This functionality offers developers a compact and easy way to access server side components. Here is an example taken directly out of ZK documentation:

Finally, ZK 6.0 takes advantage of the Servlet 3.0 Specification which supports asynchronous requests. This means that the Thread-Per-Request implementation can now be used instead of the Thread-Per-Connection one. Performance should be increased since threads can be recycled more frequently when not needed.

The best feature of Framework 6.0 is that "full remote control” capability is present in it. In which developer has control of the response when session is expired or page not found or page lost (usually timeout) in normal requests and remote view/control.www.dapfor.com/en/net-suite/net-grid/tutorial/d...

InfoQ Weekly Newsletter

Join a community of over 250 K senior developers by signing up for our newsletter. If you are based in the EEA, please contact us so we can provide you with the protections afforded to you under EEA protection laws.

Is your profile up-to-date? Please take a moment to review and update.

Email Address

Note: If updating/changing your email, a validation request will be sent

Company name:

Keep current company name

Update Company name to:

Company role:

Keep current company role

Update company role to:

Company size:

Keep current company Size

Update company size to:

Country/Zone:

Keep current country/zone

Update country/zone to:

State/Province/Region:

Keep current state/province/region

Update state/province/region to:

Subscribe to our newsletter?

Subscribe to our architect newsletter?

Subscribe to our industry email notices?

By subscribing to this email, we may send you content based on your previous topic interests. See our privacy notice for details.

You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.

We notice you're using an ad blocker

We understand why you use ad blockers. However to keep InfoQ free we need your support. InfoQ will not provide your data to third parties without individual opt-in consent. We only work with advertisers relevant to our readers. Please consider whitelisting us.