Jump to content

ZK (framework)

From Alfawiki
ZK
Company typeOpen-source software framework
IndustrySoftware development
ProductsAjax Web application framework for Java

ZK is an open-source Ajax Web application framework developed in Java, designed to facilitate the creation of graphical user interfaces for Web applications with minimal coding skills.

At its core, ZK offers an event-driven architecture based on Ajax, featuring more than 123 XUL and 83 XHTML components, along with a specialized markup language for crafting user interfaces. Developers construct application pages by utilizing these comprehensive components and respond to user-generated events, employing a model that closely resembles desktop GUI programming.

Utilizing a server-focused strategy, ZK manages automatic synchronization of component states and oversees event communication between client and server, effectively shielding developers from the complexities of Ajax. This approach provides users with an interactive experience comparable to desktop applications while streamlining the development process.

Departing from typical web request-response cycles, ZK does not rely on conventional GET or POST requests. Instead, it transmits AJAX calls that update the internal state of individual widgets. The browser receives a JSON representation of the page and employs a client-side renderer to efficiently assemble the UI through multiple client-server interactions until fully rendered.

For enhanced performance and lowered Ajax traffic, ZK offers optional client-side customization through a hybrid server-plus-client model.

In addition to component-based programming reminiscent of Swing, ZK introduces ZUML, a markup language tailored for defining rich user interfaces:

  • Crafted to enable intuitive UI creation even by non-programmers
  • Seamlessly integrates various markup languages such as Mozilla XUL and XHTML
  • Allows embedding of Java scripts (via BeanShell) and EL expressions for dynamic component control and data binding

Features

  • Pure Java development: ZK empowers developers to create sophisticated web applications without requiring expertise in Ajax or JavaScript.
  • Responsive theme support, including compatibility with Bootstrap
  • Full support for HTML5 and CSS3 standards
  • A comprehensive set of over 100 Ajax components offering diverse and advanced UI elements suitable for enterprise-grade applications
  • ZUML, a derivative of XUL, enables simplified rich UI design by separating interface definition from runtime behavior
  • Event-driven, component-based architecture accommodating multiple GUI design paradigms
  • Compatibility with MVC, Model-View-Presenter, and Model-View-ViewModel (MVVM) frameworks
  • Data binding facilitated through annotations within ZUML pages automates CRUD operations and maintains synchronization between UI elements and data models
  • Built-in application modules including spreadsheet, pivot table, and calendar components
  • Embedded scripting capabilities using Java (Beanshell) provide unified programming for both frontend and backend; also supports other server-side Java scripting languages such as JavaScript (Rhino), Ruby (JRuby), Python (Jython), and Groovy
  • Integration capabilities with existing web technologies via JSP custom tags, JSF support, Portlet integration, Servlet Filters; compatible with frameworks like Spring and Hibernate
  • Extensibility through custom UI controls; reusable control groups can be packaged as macro components
  • Robust charting features powered by ZK Charts

Differences from XUL

  • ZK operates as a server-centric framework that generates HTML, ensuring compatibility across browsers without depending on client-side Gecko engines. It interprets ZUML (a blend of XUL and XHTML) pages on the server and delivers dynamic HTML (DHTML) to web clients.
  • The user interface logic is executed on the server using Java, which broadens the range of scripting engines and libraries available. Presentation-related actions are handled by the client browser, alleviating processing demands on the server. Centralizing UI logic on the server reduces the need for extensive cross-browser compatibility testing compared to intensive DOM scripting.
  • Although ZK shares certain elements with XUL, it provides distinct and extensible component collections, including composite macro components that enhance modularity.
  • Server-side databinding annotations are supported by ZK, allowing declarative connections between UI elements and underlying data models.
  • Variations can be observed in the user interface appearance.

System requirements

  • JRE version 1.5 or higher
  • A web server compatible with Servlet 2.3 or newer

Essential

Beneficial

  • Experience with scripting languages for server-side integration like BeanShell, JavaScript, Groovy, Ruby, Scala, or Python
  • Knowledge of Object-Oriented Programming principles
  • Competency in Servlet development
  • Understanding of Ajax technologies
  • Client-side JavaScript proficiency
  • Familiarity with declarative databinding techniques
  • Experience with JSTL-like Expression Language

ZUML

ZUML (ZK User Interface Markup Language) enables the creation of sophisticated user interfaces.

  • Tailored for rapid UI development by non-developers through ZUML markup
  • Seamlessly combines multiple markup standards such as XUL and XHTML
  • Allows embedding of pure Java scripts (executed via BeanShell) alongside EL expressions for manipulating components and accessing data sources
  • Fully supported within the ZK

Client-side technologies

ZK emphasizes server-driven processing, abstracting away client-side complexities. This design facilitates implementations like ZK Mobile on Java Mobile Virtual Machines.

Starting from version 5.0, the Server+client Fusion model provides direct interaction with client-side widgets. The ZK Client Engine is constructed atop jQuery, enabling integration with jQuery-compatible libraries and widgets to enhance enterprise-level Ajax applications.

See also

External links