This book is a very good introduction to JBoss RichFaces and offers some additional material that is not available in Practical RichFaces (coverage of CDK). The book relies too heavily on Seam conversations, injections, seam-gen and other JBoss-specific technologies like Hibernate Validator. It provides good background on AJAX and good examples as well as a decent contact management example along with source code. Read up on JSF, Seam, JPA, Maven and Hibernate Validator prior to reading this book. Recommended.
JBoss RichFaces is a rich AJAX component library for JSF
allowing your Java web applications to become “Web 2.0-enabled” without writing
as of this writing is 3.3.2.SR1.
What I liked:
I learned something I did not previously know about RichFaces: XML-formatted CSS (XCSS) and that it is used a lot in the Plug-n-Skin skinnability feature.
As an experienced JSF/RichFaces developer, I appreciated the advanced topics in this book. These include creating a new skin, advanced techniques and Component Development Kit. What I liked most about this book is the subject of the RichFaces Component Developer Kit (CDK). This topic is not covered in Practical RichFaces. Although it may be true that a JSF/RichFaces developer may not need to create their own custom components, it’s definitely good to know how CDK works and what it offers. So the author covers how to develop a star rating component. In the meantime, we learn about pom.xml configuration files and Maven.
The author spent adequate time covering two of the most popular and useful components: a4j:support and rich:dataTable. He also explained the differences between h:dataTable and rich:dataTable and covered other important data iteration components like rich:dataScroller.
There was also coverage on how to minimize unnecessary form processing via ajaxSingle and process attributes usage. It’s possible to have a use case in which one HtmlSelectOneMenu component dynamically refreshes the data for another HtmlSelectOneMenu component (e.g. country and state drop-downs). In these kinds of cases, you can use ajaxSingle or process attributes to avoid all components in the form to be processed in the JSF lifecycle phases, therefore achieving a performance optimization.
A snippet was provided on the bypassUpdates attribute and how it can be used with a4j:support validation scenarios as a performance optimization (the Update Model and Application JSF lifecycle phases are not invoked).
Along the way, the reader will get some exposure to Hibernate Validator, Seam and Maven.
What I disliked:
One of the major pain points when using RichFaces with JSF/Seam is the 'The conversation ended, timed out or was processing another request' error. This is typically handled by configuring the concurrent-request-timeout attribute of the Seam manager component in components.xml as well as using the appropriate eventsQueue and requestDelay attributes for your a4j: and rich: components.
Therefore, I was surprised to see no coverage of a4j:queue component. This tag has been available since RichFaces 3.3.0 and is essential in any RichFaces developer’s toolkit. Refer to the references section of this book review for more info on this tag.
The book was using and relying on too many JBoss Seam integration examples rather than being technology agnostic (e.g. you can use JSF/RichFaces with Spring). For example, there are references to seam-gen, which is a Seam tool that allows you to create a project skeleton and reverse engineer your data model to JPA entities, Seam conversations, Seam page navigation and Seam Captcha.
No captions for the pics. This seems to be a problem with the Packt series of tech books (the Packt Seam book I reviewed had the same issue).
Pictures are not always clear (poor resolution). Formatting of the xhtml/tags in the facelets was subpar or difficult to read. Various typos throughout the book.
Little on performance optimization techniques (although this is an advanced topic). JSF/RichFaces/Seam is known to have performance problems which are being addressed in JSF 2 and RichFaces 4. One of the main problems is the fact that in AJAX there is a lot of XML text passed over the wire in the AJAX request/response cycles. When compared to Adobe Flex’s AMF3 binary protocol, this is a disadvantage in terms of performance and processing and handling large amounts of data per request.
How to improve:
Add a section on performance optimizations. Fix typos. More coverage on JSF2 and RichFaces 4. Minimize Seam integration and/or introduce some Spring integration examples. Add a4j:queue coverage.
In closing, this book is a very good introduction to JBoss RichFaces and
offers some additional material that is not available in Practical RichFaces
(coverage of CDK). The book relies too
heavily on Seam conversations, injections, seam-gen and other JBoss-specific
technologies like Hibernate Validator.
It provides good background on AJAX
and good examples as well as a decent contact management example along with
source code. Read up on JSF, Seam, JPA,
Maven and Hibernate Validator prior to reading this book. Recommended.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)