ZK

I’ve been developing web applications for the past few years. Recently, we evaluated many of the web frameworks out there to select one for the next major release of our product.

We looked at Wicket, GWT, Vaadin, ZK, Roo and a couple of others.

Wicket was quickly dropped from the list. It’s a nice framework but it lacks one important feature: A library of reusable, cross browser components. Yeah, there are a couple but they are all very basic and building complex UIs with Wicket is done in HTML and that’s just painful.

Roo is too slow and immature and suffers from the same problems as Wicket. Maintaining cross-browser compatibility for a complex web application is something that a small team of developers can’t do anymore today.

GWT was dropped because Vaadin is based on it.

That left Vaadin and ZK.

Vaadin looks good, it’s free and based on GWT which is backed by Google. The main issue with Vaadin is that the technology is … unapproachable. There is a decent set of components but tweaking them is a pain. Plus the Java -> JavaScript compilation takes a lot of time. It’s better than most other frameworks but doesn’t compare to ZK.

Why?

ZK has a big set of well designed components with a huge documentation how to tweak them. The docs explain in detail how the components are built from HTML elements, which CSS styles are used and how you can override them. There is even a visual CSS editor that helps doing this.

When working with ZK, you often run into situations where something doesn’t work but so far, I’ve found a good solution within a short time. This might also be possible with Vaadin but it didn’t happen for me.

There are a lot of powerful layouts to arrange your UIs. You can cleanly mix ZUL (the UI descriptions) with Java code to get the best from both worlds: A clean UI description and compact code to attach listeners, publish events and connect components.

Also, ZK hides the request cycle. This is one of the biggest source of problems with developers. Yeah, the request/response cycle makes it easier to write web browsers and server frameworks but it’s a major pain for application developers. With ZK, you’re writing code that looks like a desktop application. It’s a bit like GWT in this respect but GWT feels … “proprietary”. In ZK, a lot of the API is public. In GWT, a lot of the API is hidden away in final static factory methods buried in calls between 50 classes.

You can use JavaScript but the JavaScript isn’t hidden in pseudo-native functions. That ZK5 is based on jQuery is an additional bonus if you really need to get your hands dirty.

The demo page contains lots of useful examples (instead of simply listing the available components like many other frameworks). There is a sandbox where you can modify small ZK projects online.

ZK does have its share of problems, too. Testing is a weak point. Selenium probably works well enough for mouse-driven apps but if you have components which can be controlled by keyboard alone, Selenium doesn’t cut.

The documentation on the web site could be better; for beginners, it’s especially confusing that the documentation for ZK3 and ZK5 is hard to tell apart.

But all in all, I’ve been faster to solve any problem I’ve had so far with ZK than with any other web framework.

Well done.

18 Responses to ZK

  1. Joonas says:

    Vaadin does not require GWT compilation. It is only done once when you add add-on components to your project.

    GWT should also have been evaluated – it is quite different from Vaadin.

  2. Programmer Enthusiast says:

    in my opinion, zk will never reach its maximum potential and never reach its golden age.. as long as they (you know them) make zk as a commercial product..

  3. marowak says:

    @prgrammer enthusias: yes i agree instead of paying on zk pe or ee i would just go back to php

    java hosting price + zk pe / ee price = lots of money

  4. digulla says:

    Do you really need an Excel-like spreadsheet in your web app? If not, then the OSS edition of ZK should be enough for you.

    Okay, there is no Tablelayout but you can fix that by using a HTML table. There is no color picker – another rarely used component.

    From my experience, the CE edition contains most of the functions that you need for most of the standard web apps.

  5. Eric McVaughn says:

    to digulla: yep you’re right dude

    ce edition is suitable for most of standard webapps

    but me also agree to wut Programmer Enthusiast said that zk would never reach its maximum potential

    and me worried about wut he said “never reach its golden age” if that was right then zk will never be a standard

    somethin that has never been a standard will not goin to make it into historry

    • digulla says:

      Be careful what you wish for. If ZK was a standard:

      • Each bug fix would take at least 24 months – with all those meetings between developers, the design team, the ISO/OSI standards committee, big customers and government regulation.
      • There would be a new release every 5 years – good things need their time! Especially when no one can agree on what “good” means … or rather when they exactly know that every “good” for someone else means a “bad” for themselves …
      • The documentation would be 50’000 pages+ of incomprehensible “standard talk” like “for interoperability: Marks a sentence describing a non-binding recommendation included to increase the chances that XML documents can be processed by the existing installed base of SGML processors which predate the WebSGML Adaptations Annex to ISO 8879.
      • It would be dead – software is turned into a standard after it has reached it’s “golden age” – who would turn a green apple into a standard?
      • There would be a mailing list with 3 experts who never answer because they’re busy in a meeting.
      • There would be no wiki – standards are neither meant to be understood by mere mortals nor *gasp* changed by them.
      • ZK would contain lots of useless components because some big customer might have used them at some time in the past even though no one could say for sure.
      • Useful components would contain bugs that can’t be changed because of fear to break compatibility with a standard definition that seemed reasonable at the time it was written

      You want standard? Get Glassfish, use J2EE and JSF. Good luck! 😉

    • Rick says:

      good lord, is this grammar an attempt at being cute?

      “me worried wut he said” – really??

  6. Eric McVaughn says:

    maybe he means “de facto standard” 🙂

    but truly me love zk dude

    zk is awesome framework

  7. Ondrej Medek says:

    Do you know any Google application based on GWT? Nope, Google does not use it. GWT is too overbloated, Vaadin is riding on a wrong horse. ZK will be winner.

  8. Ashish says:

    Better than ZK Sandbox use ZK Fiddle. Save your example codes online and share the demo. You can also link those examples directly within your ZK forum posts so you can get quick response from the community.

  9. Pau Carré says:

    ZK is a really nice framework. The only drawback I see is that it requires lots of network resources.

    • digulla says:

      I’m not so sure about that. Old apps send the whole page with every request, while ZK sends lots of small ones. In the end, both might be pretty similar.

  10. nikos101 says:

    ZK is one of the best out there and it is getting better.

  11. A Jaidka says:

    I am using ZK from last 2 years, it is really good when you talk about development speed. Also you dont need a html programmer or web designer most of the time. Evaluation version has lot of stuff you need.
    2 Problems
    a) EE/PE is costly
    b) Upgrading the ZK version in your existing project may break everything. Backward compatibility is very poor.

    Still it is much better than GWT and Wicket

  12. Using ZK for a year now, it’s nice but has some drawbacks. The internal code is not really good, it uses to many static helper methods and it’s a real drag to unit test (because the whole thing is effectively a monolith). Most of the things you write cannot be completely tested without Selenium or ZATS.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s