Do you have a choice?

by Ariel Raz for JavaPureFaces

Why are java developers using JSP/XML static-template web frameworks to develop their GUI? Is it really the best API for it?
The reason I have heard is that it allows non-programmers to design and build the GUI, and then have the developer plug into it the code. This is a nice theory, but I haven’t seen it happen this way. I have always had to write both the JSP pages and the java code myself. Many times I did get the GUI “look and feel” from a graphical designer in an HTML format, but that was it.
I cannot see how letting a non-programmer write the JSP/XML is a good way to develop web applications because it requires an enormous, inefficient amount of communication between the GUI designer and the java developer, and it creates a maintenance nightmare.
I think java developers are using JSP/XML static templates because there is currently no better java API to create the web GUI. Am I wrong? If there was a good object oriented java API, would developers still be using JSP/XML static-template web frameworks?

3 Responses to “Do you have a choice?”

  1. Nicolas Says:

    In fact, we have found Zk, that appear one of the most complete ojbect base web tool.

    They promote their XML format, but you can do all with their object model and can do something very similar than swing.

    It’s Ajax based, with most of the code sitting on the server side. You can dynamically add, removed or modify content using the java object model.

    Main problem here is the dual licencing that will prevent it to be broadly used.

    Your framework has support for full AJAX features ?

  2. ariel.raz Says:

    Nicolas, thank you for your comment. I am not so familiar with ZK. Do they support methods and attributes binding to any object? Or is it a more swing/GWT where you need to create an object for any input and button?
    Also in order to create your custom GUI component do you need to extend a ZK class, or can you use any existing class and only implement and interfaces to get the framework’s functionality?
    As for Ajax, Purefaces is currently implemented on top of tomahawk, which does not support Ajax. We have some preliminary testing completed, and are in the beginning phases of using RichFaces with PureFaces in order to incorporate full Ajax support.

  3. Nicolas Says:

    I’m not a Zk expert. We are looking forward a good RIA framework and found Zk to be a potential good choice.

    I am confident that Zk is a good choice, but because it’s not free to used and deploy, it will be difficult to convince our boss to use it.

    I’m not an expert, but it really depends on what you are doing. Some components like tables support using arbitrary beans, but I think it’s more about swing behaviour when you are dealing with the object model.

    For me it’s very nice because you gain compilation checking for all your code and benefits of code completion of your IDE and in my humble opinion it’s better in the long run.

    I have experience of Swing and Struts/JSP projects, and swing is far more superiour than the JSP classic approach.

    If you are using the XML notation you don’t create objects, you have something very similar to JSP or JSF. (The objects are created by the framework).

    If I remember right, you can use an interface for creating new component, but i guess, you’d have to check in the Zk documentation and tutorials to be sure.

    One of the main point of Zk, is that on the server side you manipulate your object model really like swing. If you add a button on a tab in your gui, it will appear on the next refresh, or instantly if it is in response of a client event.

    With this sort of behaviour, you can make your own command pattern, for menu, contextual menus, icons and button, and like in swing, enable or disable them just by enabling or disabling the command. The command can be just defined in an XML files with user right and so on… And voila, you have toolbar, menu, buttons and contextual menu with an unified behaviour.

    It’s also easy to add a tab for each result of a research, implement an MDI system and so on. It’s the sort of thing, that i think you can do in your framework but that benefit even more when you have ajax enabled.

    I do not really like JSF like framework because like you i think JSP/XML like editing of GUI is not a so good thing. Nice for prototyping, but as soon has you have a real gui, an object model is far more flexible and powerful.

    I didn’t thought it was possible to have a really good object model sitting on top of JSF because of the complexity of JSF itself that seat on top of many layers. In richface, the main problem of AJAX behaviour is that you have to say in the action what part of the GUI will be refreshed explicitely. In Zk, it’s simply the zone that has changed that is updated, no more, no less. So you can implement a true MVC model with listeners or things like that. But maybe you can manage to do that sort of things too.

Leave a Reply