Previous: Object Design
What kind of web presentation framework would be suitable for the solution? What kind of presentation framework everyone's need?
What I would have is a tool which can take my HTML, take my application logic, and generate a dynamic content from them. I want the result to look as my HTML but to contain dynamic data from my application logic. What choice do we have in Java world?
Tapestry vs. JSF
Tapestry and JSF are most popular component-based Java web frameworks for January 2006. Both Tapestry and JSF can be made to work with HTML templates. Tapestry was born with it, JSF require some add-ons.
We have massive and growing support for JSF from software vendors, so we can expect it will soon became the most popular Java web framework. So do JSF wins? I don’t know. But I’m going to use it.
JSF with HTML templates
JSF is oriented to work with JSP by default. To satisfy our requirements we should look for 3rd party tools to add support for HTML templates. Currently they are: Struts Shale with Clay plugin; Facelets; and my custom JSF templating library.
Struts Shale is promising project even if we look at how Struts 1 was successful. I found very little documentation on Shale unfortunately.
Facelets is also very promising since its author works with Sun JSF team. Facelets may fit our requirements well.
Is JSF Right?
What bugs me with commonly recommended approach to development with JSF is... hmm... complexity? What they tell me to do is, to be short, to write HTML or JSP, then write a JavaBean for getting information from business logic to JSF and back, then wiring that JavaBean thru xml code, and finally I can think of my say MessageView or NewMessageUI component which I need to wire with JavaBean and provide output finally.
Why do I need custom components?
I can manage to do some things without coding my custom MessageView and just using standard JSF HTMLTable. But what if I would to have a common MessageUI component for viewing / editing the message and to be able to extract common functionality into the parent in the future?
So the idea was that coding would be simple if I will have no need to code additional JavaBeans. I developed a custom JSF template lib which lets me to create JSF components with no need to create additional classes or do xml coding. Now I’m going to check if Facelets will let me to do this.
Next: Frameworks Continued