What's ZK

From Documentation
Revision as of 04:58, 17 December 2009 by Zkwikiadmin (talk | contribs) (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…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template: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 to familiarize yourself with the ZK features right away.

ZK: What It Is

ZK is an event-driven, component-based framework to enable rich user interfaces for Web applications. ZK includes an AJAX[1]-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

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.
ZK handles browser compatibility issues for developers. You don't have to write javascript to handle it anymore. Write once, run in every browser.

XML based GUI

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[2] into the same page. Currently ZUML supports two set of tags, XUL and HTML.

ZK executes java code on the server

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

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[3], JavaScript[4], Ruby[5] and Groovy[6]. 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

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 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 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 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 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[7].

ZK: Limitations

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.

Notes

  1. AJAX is coined by Jesse James Garrett in Ajax: A New Approach to Web Applications.
  2. A tag is an XML element. When a ZUML page is interpreted, a corresponding component is created.
  3. The Java interpreter is based on BeanShell (http://www.beanshell.org).
  4. The JavaScript interpreter is based on Rhino (http://www.mozilla.org/rhino).
  5. The Ruby interpreter is based on JRuby (http://jruby.codehaus.org/).
  6. The Groovy interpreter is based on Groovy (http://groovy.codehaus.org/).
  7. For devices with small screen, you usually have to adjust the presentation pages.

Quiz

  1. Where does ZK execute java code?
  2. ZK has a XML based GUI, what is its name?
  3. What script code does ZK support now?
  4. Where does ZK execute embedded script code? Server or client?
  5. Does ZK need tunnel or RMI? Why?

Refernce

Template:DevelopersGuidePageFooter