Pathfinder Blog
Topic Archive: ZK

ZK 3.5 Released with Comet Support

ZK 3.5, the latest version of the server-side Ajax framework, is out with a raft of new features. Three of those features really stand out for me:

  • Comet server push
  • Customization of look and feel
  • Performance monitoring

Server push via polling has been available in ZK for a while, and Comet in the ZK "Enterprise Edition," but now it is available to everyone. And it is pretty easy to use: "The implementation of server push is transparent to developers. ZK chooses which implementation to use according to the edition of ZK automatically, but it is configurable."

Customization of look and feel has gotten much easier. ZK has followed the example of a number of other frameworks in styling its widgets with predictably named CSS styles. Changing the look and feel of an application is now as easy as changing the ZK widget style sheet. Styles can further be overridden on a widget instance-by-instance basis.

Performance monitoring is perhaps the most exciting new feature. Client-side tools such as YSlow can guide optimization efforts and give you point in time performance snapshots. But critical applications need to be monitored and tracked end to end over their lifespan. With ZK 3.5, you now have the plumbing to instrument your application to capture five data points for each request:

  • T1, the time browser sends a request to server
  • T2, the time server receives a request
  • T3, the time server sends a request to browser
  • T4, the time browser receives a request from server
  • T5, the time the browser finishes processing a request

ZKStudio 0.8.2

There's also a new version of ZKStudio for Eclipse out. The major change is that it now supports auto update via http://studioupdate.zkoss.org/studio/update

A New ZK Tutorial

There are already quite a few tutorials and mini talks on the ZK site, but one more never hurt. Over at Dr. Dobb's, Andrzej Sekula guides you through "Hello, World!" with ZK, while explaining architecture, features and few other things. Worth a look.

Technorati Tags: , ,

Server-side Ajax Framework: IT Mill Toolkit 5, now with GWT

I've long been a proponent of server-side Ajax frameworks -- frameworks that store state on the server and use an Ajax engine in the browser to drive the display. The advantages: state and control logic stay on the server, so security compromises that exploit client-side state and logic are more difficult to pull off; developers can work in one language and, for the most part, ignore the fact they are writing a web application. The disadvantages: the server retains a large amount of state, so scaling your application can be problematic.

There's one other large disadvantage to these open source server-side frameworks: for every 100 Java developers who use the framework, there is only 1 of them that can do serious JavaScript development. That means that the lifeblood of these frameworks -- the development of new and cool JavaScript widgets -- is sluggish at best. That has certainly been the case with the best known 3 frameworks: Echo2, ZK and ThinWire (though ZK does wrap a number of Ajax widget libraries, such as Dojo).

Continue reading »

Topics: , , ,

ZK on Android

I'm glad that my Comp Sci classes were taught differently from my Art History courses, otherwise all I would remember is the hum of the slide projector and the taste of sleep in my mouth. Instead I remember the Bridge Pattern and the wonderful things it can do for you. Specifically, you can decouple an abstract component GUI from it's concrete implementation (see AWT). This makes the task of retargeting the GUI framework to a new platform comparatively quick and easy.

Now server-side Ajax frameworks (Echo2, ZK, etc.) have been using the Bridge Pattern for a while, but with the exception of OpenLaszlo (Flash and Ajax) and WidgetServer (Ajax, Swing Applet, Swing Desktop), they only target the browser, i.e. one platform.

Now ZK Mobile, an extension of the ZK Framework for mobile devices, is showing the power of the Bridge Pattern in the mobile world. On 11/12/2007 Google released the Andriod SDK and two days later, on 11/14/2007, the ZK team released an extension to ZK Mobile that allows you to run your ZK apps on Android. How is that for quick turnaround? Good design can be good for you and good to you.

The ZK "smalltalk" demos a simple Twitter application for the Android SDK.

Amazing how little work is necessary to get this app on a mobile phone.

Technorati Tags: , , ,

ZK 3.0 Released

It's been a bit over a month and a half since ZK 3.0 RC was released and the ZK team has sure been busy. The list of new features is long, but has a surprisingly large number of them are new from RC1 to final:

  • The performance of ZK is much improved - four ~ five times faster.
  • Server push (really polling) is enabled which allows you to update client’s information actively and the usage is simple and intuitive.
  • The ZK Layout component which simplifies the job of UI designer.
  • Customize layout of ZK components using CSS definitions.
  • Add forward and apply properties to realize MVC approach more easily.
  • SimpleListModelSharer - integrates server push and ListModel allows you to update data of clients based on the same data automatically.
  • New expression of annotation is ease of use, and easy-to-read.
  • TreeModel is introduced which simplifies the job of Tree rendering.
  • Flash components allow you to play audio and video files. (including youtube clip)
  • Native namespace is implemented to speed up the performance while integration with HTML.
  • To speed up the performance of ZK, EL evaluator is pluggable, and a new way to render ZK components is introduced.
  • More integration with other frameworks, ZK has integrated with JSF, JSP, and Ext-JS.

I find the addition of the layout component interesting. It seems that everyone from GWT, Tibco GI, Ext JS, etc., is moving toward the programmatic model of layout, i.e. DockPanel and so on. In fact, several of the Web 1.0 frameworks have been doing this for a while now, and of course the desktop GUI frameworks have been doing that since the stone age, so the wheel does seem to get reinvented again and again.

I do think that CSS, while giving you fine-grained control, can be a bit unwieldy for day-to-day use. Being able to stuff widgets into containers and have them handle layout is very tempting and convenient. But note the presence of fine-grained layout managers (GridBag anyone?). In my many years of developing applications, I've seen projects sink under the weight of getting everything within a pixel of perfect. Under those circumstances, fighting with CSS through the damp blanket of a layout manager is torture indeed.

P.S. ZK Mobile 0.8.7 was also released and is now compatible with ZK 3.0.

Technorati Tags: ,

ZK 3.0 RC Released

One of the enduring criticisms of ZK, the server-side Ajax framework, has been against its perceived slow performance. Critics have observed, and supporters have conceded, that applications written with ZK seem a touch slow. So it's no surprise that a major focus of the latest major release has been improved performance. The ZK team found two major bottlenecks in performance testing:

After a series of stress test and reviewing the kernel code, we found out 2 bottlenecks on ZK 2.4.1 and fixed them in ZK 3.0 RC.

  1. The executing time is too expensive when rendering components. ZK uses templates to render components, and the EL is generally used in templates to simplify the variable access and templete maintenance. However, when the concurrent access rises to a large number, the overhead on rendering component with EL is too heavy.
  2. Threads spend too much time on waiting the synchronization when many threads access to the same cache under current cache mechanism.

ZK 3.0 RC solves these 2 bottlenecks by using the renderer class and new cache mechanism. The test result shows ZK 3.0 RC is four ~ five times faster than ZK 2.4.1.

I haven't validated these performance figures myself, but an initial comparison between some demo applications confirms a much more responsive user experience.

ZK 3.0 RC has also added a number of other new features:

  • Server push is enabled which allows you to update client’s information actively and the usage is simple and intuitive.
  • Add forward property of components to forward event without programming.
  • New expression of annotation is ease of use, and easy-to-read.
  • TreeModel is introduced which simplifies the job of Tree rendering.
  • Flash components allow you to play audio and video files. (including youtube clip)
  • Native namespace is implemented to speed up the performance while integration with HTML.
  • To speed up the performance of ZK, EL evaluator is pluggable, and a new way to render ZK components is introduced.
  • More integration with other frameworks, ZK has integrated with JSF, JSP, and Ext-JS.

Server push was already supported in ZK through use of the timer component, but the enhancements make it even easier (note: we're not talking comet, but rather client polling). Even more exciting for me is the dynamic loading of ZUML (the XML-based markup language for specifying ZK interfaces) pages dynamically from sources such as a database. That's very helpful if you want to allow non-developers to deploy interface changes without having to spit out ear or war files.

As usual, the ZK folks have done a good job documenting the changes and additions. It's too early to tell if 3.0 will solve all of ZK's previous shortcomings, but ZK is well on it's way to becoming my favorite server-side framework.

Technorati Tags: , ,

ZK Integrates with Seam, Seasar, more

As an open source project, ZK is extremely active. It's enough to give you a warm and fuzzy feeling if you are concerned about it's long term viability.

So, what's cooking in the ZK kitchen? Lots of integration with application frameworks and third-party libraries.

  • ZK Seam allows you to integrate ZK with Seam, naturally enough. What is Seam? A framework that is the marriage of JSF and EJB3. I have to say that I've developed such a deep allergy to both EJB and JSF that their integration seems more of a nightmare than a boon. It's sort of like that movie, The Pope of Greenwich Village, a great script and good director, but it contains my two least favorite actors, Mickey Rourke (EJB) and Eric Roberts (JSF). Offers of therapy to help me get over my aversion by showing me how EJB and JSF can be "done right," are hereby politely refused.
  • Integration with Seasar. What is Seasar? It is Kanji for Spring Framework. ;-) Actually, it is a dependency injection framework that resembles Spring a great deal, but claims to get you out of application context XML hell by letting you auto assemble object injection hierarchies using regular expressions and careful placement of classes in a directory structure. You can read more about Seasar here and here.
  • Further addition of yui-ext components (now known as Ext JS), a really first rate set of Ajax widgets, to ZK. Grids, drag and drop, data bindings. See here for the tutorial.

Also, you should give a look at the ZK Mobile framework, now at version 0.8.5. Basically you develop apps much the same way you do in ZK for the web, ZUML, etc., but it has a different set of components.

Technorati Tags: , , , , , ,

ZK 2.4.1 - Performance Improvements, Better Testing Support and YUI

The folks over at ZK have released 2.4.1, which contains a host of performance improvements, as well as better support for testing. From the announcement:

  • The transmission time over the slow Internet connection is improved dramatically due to the use of the gzip compression and the removal of unused codes from prototype and script.aculo.us.
  • Tree controls can now display items in multiple pages. It improves the performance of huge trees dramatically.
  • An option not to disable HTML tags behind the modal window. It is designed to speed up the opening of a modal window on a sophisticated page.
  • The generation of UUID of components, pages and desktops is customizable. It is designed to work with the record-and-replay testing tools.

There's also some discussion in a new "small talk" on how ZK handles the whole yucky ThreadLocal business with Hibernate, Spring, etc. Can't say I like this part of the ZK design, as it makes it hard to cluster apps for failover.

Perhaps the most interesting thing about this release, however, is that they've started to do the work of integrating YUI-EXT with ZK. See this "small talk" on it.

Technorati Tags: , , ,

Beefing Against OpenLaszlo

Elliotte Rusty Harold is a well know author on Java and XML. His take on OpenLaszlo is that it is a misuse of XML.

OpenLaszlo seems like a confusing mix of JavaScript and XML. I never got clear on just why there was so much XML. It seemed like a classic case of misusing XML because it’s there. I suspect JavaScript alone wasn’t strongly typed enough, and the developers didn’t want to bother writing a parser for a custom format. GWT, by contrast, is pure Java so it’s a lot cleaner. I like XML; I like Java; and if I’ve taken enough drugs, sometimes I even like JavaScript. However mixing them together in the same program just seems like a really bad idea. It’s like constantly switching from English to Chinese and back again in the same sentences.

I've got to agree that the mixing of XML and Java/Javascript seems like a bad idea. As I observed in Cognitive Load and the Superiority of Server-Side Ajax GUI Frameworks:

But why do we get a headache? Back in the 1950's, a professor of Psychology named George Miller observed that the average human being could retain seven items in short term memory, plus or minus two items. When we work with ideas or concept in any sort of analytical thinking, we run up against this limitation again and again.

John Sweller, a professor of Education, came up with the idea of cognitive load in the late 1980's. The basic idea was that your ability to learn and problem solve was limited by your short term memory. If a particular learning task required keeping track of many concept at the same time, it is said to have a high cognitive load and as a result you don't learn as well or as easily. In fact, in analytical tasks like doing complex arithmetic, it can increase the rate at which you make errors. There's a whole body of literature on cognitive load, cognitive stress, etc. Applied to our example of web application development, we see that juggling all of those different concepts in different programming and markup languages and runtime environments in our head, creates a high cognitive load, increases our error rate and impedes our ability to problem solve.

The same criticism could  be made of ZK, with it's ZUML that mixes XML and Java (or other languages). I'm still OK with using XML to wire up components, such as Spring and SwiXML, as these are minimal and have a configuration purpose.

Technorati Tags: , , ,

Topics: , ,

ZK 2.3.1 Released - Adds new CAPTCHA Component

ZK continues to kick Echo2's ass when it comes to releasing new versions. I know activity for activity's sake is not the point, but Echo2 has stagnated a bit while the Ajax world has marched steadily on.

OK, enough about my disappointment. What about the new release of ZK 2.3.1? From the announcement:

    • New (and simpler) way to customize the display of error messages.
    • Support the file download that opens a Save dialog at the client to let the user download arbitary file from the server.
    • A new component called captcha is added to simplify the use of CAPTCHA.
    • Java Interpreter (based on BeanShell) supports hierachical scopes, aka., nest scopes.

    I haven't seen CAPTCHA components in too many places yet. CAPTCHA is pretty much required for any app that allows public registation, so I'd expect to see this one used pretty heavily.

     
      Technorati : , ,

Topics: ,

How to Write ZK Components

A big selling point of the server side component Ajax frameworks like ZK and Echo2 is the ability to leverage a library of components so you can stick to the server side environment and not have to bother with Javascript, CSS, etc. Of course in order for this to work out, there has to be a healthy library of components, and for there to be such a healthy library, the writing of those components has to be easy or at least well documented. Over at Javaworld, they've got a three part series on how to write ZK Forge components (part 1, part 2, part 3).

The three parts show how to write a Hello World, a custom button, and a custom panel component, respectively. Note, since this is where the rubber meets the road, i.e. the Java framework meets the browser in all its Javascript/CSS/XHTML glory, you will need to have some of those skills to really benefit from these tutorials.



Technorati : , , ,

ZeroKode 0.8 Released

zerokode2.PNG

I've already blogged about ZeroKode, the drag-and-drop visual GUI design tool for ZK. Well, version 0.8 has been released. It's a little slicker, more responsive, but it still has the same issue of requiring a knowledge of the ZK component heirarchy. A lack of popups over the components is also an issue, since the icons are not exactly self explanatory.

This brings up an issue with these new web-based RIA's. I say "new" because they are not new to the desktop, but new to the developers of web applications. These are concept such as the "explorable interface," where the cost in time and effort of trying out things is minimal. ZeroKode fails in this regard in several ways. For one, finding out that a component doesn't belong as a child in the component heirarchy by trying to drag it onto that heirarchy and having to deal with a timeconsuming popup. Further, the properties form for each component is accessed through another popup -- another time waster.

chess.jpg

This is also a reason why an "undo," probably linked up to the back button, is so important in RIA webapps; without an undo, the cost of exploring is high. As anyone who has played chess knows, humans are very good at searching forward, but lousy at backtracking. That's why so few of us are Grandmasters.


Technorati : , , ,

Wt - Another Server-Side Ajax Framework, This Time in C++

We've had two server-side Ajax frameworks for a while now -- Echo2 and ZK -- that tranform web development into desktop GUI development. Now add a third: Wt, or "Witty" as it's known (here for tutorial), is a C++ framework. From the tutorial above, a classic manifesto of the server-side Ajax framework:

Because the API of Wt makes abstraction of the underlying technologies (Forms, JavaScript or AJAX), Wt chooses how to communicate with the web browser depending on technology support in the browser. The responsibility for making the application work in the jungle of web browsers is therefore also transferred from the application developers to the library developers.

The framework has most of the usual widgets and behaviors, including a tree widget and drag and drop.

witty.PNG

Now my last serious C++ project was in institutional mutual fund trading system back in 1998, so I'm as rusty as Davey Jones' belt buckle when it comes to that language. To top it all off, I have Java and C# running through my brain, so I'm likely to introduce illigitimate syntax from these close cousins; but I know there are still plenty of talented and experienced programmers out there working with C++. More importantly, three frameworks officially makes for a trend, which means server-side component GUI frameworks are officially a "good idea."

 
  Technorati : , , , , , ,

ZK Now Supports Javascript, Groovy, Ruby

As promised, the latest release of ZK (ZK 2.3 RC) now supports more languages in zscript than just Java. It now supports Javascript, Groovy and Ruby. Futhermore, you can easily add support for a new language in half a day (maybe with some practice, no?) by extending a simple interpreter class. That's assuming, of course, that a Java-based interpreter already exists for the language.

For those of you not familiar with ZK, it is a Ajax framework that has you write your application logic on the server-side and treats the browser as a simple display server (as opposed to client-side frameworks that implement lots of application logic in the browser and treat the server more as a collection of web services). You write your application using ZUML, an XML-based markup language, assembling interface components in a way very similar to the desktop GUI component/event driven model. You tie your app logic into the markup language using zscript statements:

<window title="Fileupload Demo" border="normal">
<image id="image"/>
<button label="Upload">
<attribute name="onClick">{
Object media = Fileupload.get();
if (media instanceof org.zkoss.image.Image)
image.setContent(media);
else if (media != null)
Messagebox.show("Not an image: "+media, "Error",
Messagebox.OK, Messagebox.ERROR);
}</attribute>
</button>
</window>

In the sample above, we are using Java as the scripting language. Now you can use Ruby, Javascript or Groovy in it's place. Realize that scripts written in these languages are executed on the server, not the browser.


Technorati : , , , ,

ZK Roadmap for 2007

Tom Yeh over at the ZK project has released his roadmap for 2007. It's an intriguing list of tools, features, and developer support:

  • Expanded support for data binding.
  • A visual design tool for Eclipse.
  • Support from mobile platforms: ZK Mobile, a Java ME client, will be released in the first half of 2007.
  • To work with existing applications more efficiently, ZK components will be available in the form of JSP tags. Maybe also as JSF components.
  • Support for browsers without Javascript.
  • Support for other scripting languages than Java, such as Groovy and Ruby.
  • ZK books and more online tutorials.
  • "Mega" components, such as spreadsheets, forums, etc.

Lots of good stuff, especially the news about ZK Mobile and the visual design tool.

One thing I'd like to see happen with ZK (and Echo2, the other, similar server-side framework), is the development of something similar to the Spring Rich Client framework. What is Spring Rich Client?

The Spring Rich Client Project (RCP) is a sub-project of The Spring Framework. Spring-RCP's mission is to provide an elegant way to build highly-configurable, GUI-standards-following rich-client applications faster by leveraging the Spring Framework, and a rich library of UI factories and support classes. Initial focus is on providing support for Swing applications but a goal of Spring-RCP is to be view agnostic as much as possible.

Both ZK and Echo2 resemble desktop GUI frameworks, and thus could benefit in the same way as Swing. In fact, if Spring-RCP is truly view agnostic, it might make sense to try to use Spring-RCP directly.


Technorati : , , ,

Topics: ,

About Pathfinder

  • We design and build extraordinary applications for companies looking to make the next great idea a reality.
  • learn more

Topics

WordPress

Comments about this site: info@pathf.com