What's ZK"

From Documentation
m (Created page with '{{DevelopersGuidePageHeader}} Welcome to ZK, the '''simplest way''' to make Rich Web Applications. This chapter describes how ZK works. You may skip this chapter if you prefer t…')
 
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DevelopersGuidePageHeader}}
+
{{ZKDevelopersGuidePageHeader}}
  
 
Welcome to ZK, the '''simplest way''' to make Rich Web Applications.
 
Welcome to ZK, the '''simplest way''' to make Rich Web Applications.
This chapter describes how ZK works. You may skip this chapter if you prefer to familiarize yourself with the ZK features right away.<br>
+
This chapter describes what ZK is and is not. You may skip this chapter if you prefer to familiarize yourself with the feature and functionality of ZK right away.<br/>
  
 
==ZK: What It Is==
 
==ZK: What It Is==
ZK is an event-driven, component-based framework to enable rich user interfaces for Web applications. ZK includes an AJAX<ref>AJAX is coined by Jesse James Garrett in Ajax: A New Approach to Web Applications.</ref>-based event-driven engine, a rich component set of XUL and XHTML and a markup language called ZUML (ZK User Interface Markup Language).
 
  
===Similar to desktop applications===
+
ZK is an event-driven, component-based framework powering rich user interfaces for Web applications.
:With ZK, you represent your application's GUI in feature-rich XUL and XHTML components and manipulate them upon events triggered by user's activity. The synchronization of component content and the pipelining of events are done automatically by the ZK engine.
 
  
:Your users get the same engaging interactivity and responsiveness of the desktop application, while your development retains the simplicity of developing desktop applications.
+
Events triggered by an end user, by an application, by server push and even by message queues are stacked and handled using the same mechanism.
  
:ZK handles browser compatibility issues for developers. You don't have to write javascript to handle it anymore. Write once, run in every browser.
+
All UI components are simply POJOs, which developers can instantiate, manipulate and extend directly and straightforwardly.
  
===XML based GUI===
+
Notifications of events and synchronization of component's states are done automatically making Ajax communication and browser dependencies totally transparent to developers.
:ZK supports a markup language called ZUML. ZUML, like XHTML, enables developers to design user interfaces without programming. With XML namespaces, ZUML seamlessly integrates different set of tags<ref>A tag is an XML element. When a ZUML page is interpreted, a corresponding component is created.</ref> into the same page. Currently ZUML supports two set of tags, XUL and HTML.
 
  
===ZK executes java code on the server===
+
In addition to pure Java,  ZK allows developers to design UI in a markup language called ZUML (ZK User Interface Markup Language), which is an enhanced version derived from XUL. ZUML supports EL expressions, declarative control, and many scripting languages, including Java ([http://www.beanshell.org BeanShell]), Groovy, Ruby, and more.
:You can write event handler of GUI component in java. You can also write business logic in java. All Java code, whether implemented in zscript in ZUML, or in java file, is executed at server side. Therefore, you can fully utilize any java library as you like.
 
  
===ZK executes all embedded scripting code on the server===
+
While most of ZK application's code, for best productivity and security, runs at the server, ZK's Server+Client Fusion architecture allows developers to optimize responsiveness and leveraging the client's computing power by distributing some of the application code to the client.
:For fast prototyping and customization, ZUML allows developers to embed EL expressions, and scripting codes in your favorite languages including but not limited to: Java<ref>The Java interpreter is based on BeanShell (http://www.beanshell.org).</ref>, JavaScript<ref>The JavaScript interpreter is based on Rhino (http://www.mozilla.org/rhino).</ref>, Ruby<ref>The Ruby interpreter is based on JRuby (http://jruby.codehaus.org/).</ref> and Groovy<ref>The Groovy interpreter is based on Groovy (http://groovy.codehaus.org/).</ref>. It's easy to integrate other language interpreter. Then, developer can choose his favorite language. Developers could choose not to embed any scripting codes at all if they prefer a more rigid discipline.
 
  
 
==ZK: What It Is Not==
 
==ZK: What It Is Not==
=== Not more than Presentation tier===
 
:ZK assumes nothing about persistence or inter-sserver communication. ZK is designed to be as thin as possible. It does not require or suggest any other back-end technologies. All of your favorite middleware technologies such as: JDBC, Hibernate, Java Mail, EJB or JMS work as they used to.
 
  
===No tunnel, RMI needed===
+
ZK assumes nothing about back-end services, persistence or inter-server communication. ZK is designed to be as thin as possible, while providing the seamless integration with other Java technologies. All of your favorite Java technologies such as JDBC, Hibernate, Spring, JSP, Java Mail, EJB or JMS work the same way as you are familiar with.
:ZK doesn't provide a tunnel, RMI or other API for developers to communicate between clients and servers. This is because all code runs at the server within the same JVM.
 
  
===No obligate design pattern===
+
ZK doesn't provide RPC, RMI or other API for developers to communicate between clients and servers, since all code runs at the server<ref>Client-side programming could leverage jQuery's Ajax mechanism or ZK Update engine to synchronize with the server manually.</ref>.
:ZK doesn't enforce developers to use MVC or other design patterns. Whether to use them is the developer's choice. Although ZK does provides good support for MVC pattern.
 
  
===Not limited to XUL===
+
ZK doesn't enforce developers to use scripting, pure Java, markup languages, MVC or other design patterns, but providing them as options to satisfy the different skill set, methodologies, and demands that your team might have or be required to.
:ZK is not a framework aiming to bring XUL to Web applications. It is aimed to bring the desktop programming model to Web applications. Currently, it supports XUL and XHTML, in future it might support XAML, XQuery and others.
 
  
===Not limited to Ajax===
+
ZK supports AJAX transparently but a ZK application is not limited to the scope of Ajax applications. With ZK Mobile and ZK Android, your applications could reach any devices not equipped with a modern browser.
:ZK embeds AJAX in the current implementation but it doesn't end in where AJAX does. With ZK API for Mobile devices, your applications could reach any devices that support J2ME such as: PDA, mobiles and game consoles. Moreover, you don't need to modify your application at all<ref>For devices with small screen, you usually have to adjust the presentation pages.</ref>.
 
  
==ZK: Limitations==
+
<blockquote>
:ZK is not for applications that run most of tasks at the clients, such as 3D action games.
+
----
:Unless you write a special component, ZK is not for applications that want to leverage the computing power at the clients.<br>
 
'''Notes'''
 
 
<references/>
 
<references/>
 
+
</blockquote>
== Quiz ==
 
#Where does ZK execute java code?
 
#ZK has a XML based GUI, what is its name?
 
#What script code does ZK support now?
 
#Where does ZK execute embedded script code? Server or client?
 
#Does ZK need tunnel or RMI? Why?
 
 
 
== Refernce ==
 
*[[Introduction_fork|Introduction of ZK]]
 
 
 
{{DevelopersGuidePageFooter}}
 

Latest revision as of 09:47, 24 September 2010

Stop.png This documentation is for an older version of ZK. For the latest one, please click here.


Welcome to ZK, the simplest way to make Rich Web Applications. This chapter describes what ZK is and is not. You may skip this chapter if you prefer to familiarize yourself with the feature and functionality of ZK right away.

ZK: What It Is

ZK is an event-driven, component-based framework powering rich user interfaces for Web applications.

Events triggered by an end user, by an application, by server push and even by message queues are stacked and handled using the same mechanism.

All UI components are simply POJOs, which developers can instantiate, manipulate and extend directly and straightforwardly.

Notifications of events and synchronization of component's states are done automatically making Ajax communication and browser dependencies totally transparent to developers.

In addition to pure Java, ZK allows developers to design UI in a markup language called ZUML (ZK User Interface Markup Language), which is an enhanced version derived from XUL. ZUML supports EL expressions, declarative control, and many scripting languages, including Java (BeanShell), Groovy, Ruby, and more.

While most of ZK application's code, for best productivity and security, runs at the server, ZK's Server+Client Fusion architecture allows developers to optimize responsiveness and leveraging the client's computing power by distributing some of the application code to the client.

ZK: What It Is Not

ZK assumes nothing about back-end services, persistence or inter-server communication. ZK is designed to be as thin as possible, while providing the seamless integration with other Java technologies. All of your favorite Java technologies such as JDBC, Hibernate, Spring, JSP, Java Mail, EJB or JMS work the same way as you are familiar with.

ZK doesn't provide RPC, RMI or other API for developers to communicate between clients and servers, since all code runs at the server[1].

ZK doesn't enforce developers to use scripting, pure Java, markup languages, MVC or other design patterns, but providing them as options to satisfy the different skill set, methodologies, and demands that your team might have or be required to.

ZK supports AJAX transparently but a ZK application is not limited to the scope of Ajax applications. With ZK Mobile and ZK Android, your applications could reach any devices not equipped with a modern browser.


  1. Client-side programming could leverage jQuery's Ajax mechanism or ZK Update engine to synchronize with the server manually.