Win Your Copy: Seam In Action
ISBN: 1933988401
Reviewer RatingsRelevance:
Readability:
Overall:
Buy it now
One Minute Bottom Line
Review
Part 1. Teeing off with Seam
Chapter 1. Seam unifies Java EE
The major concept behind Seam is to serve as an adjunct to Java EE. JSF, a relatively recent entrant to the specification, has not been uniformly a brilliant success; EJB has been a bitter pill for a long time; and other alternatives are rapidly gaining ground, such as Ruby on Rails. The Java EE specification has taken some important steps forward recently, including EJB 3.0, for instance; but we haven't yet reached the nirvana wherein JSF components cavort playfully on green fields with EJB components under the watchful gaze of JTA shepherds. Seam integrates and extends the out-of-box Java EE functionality with its own, in which the Seam context and EL play a major role. And best of all, Seam is not limited to JBoss alone!
Chapter 2. Putting seam-gen to work
One of the pluses of using Seam is how easy it is to set up your initial project structure. Seam-gen, the code generation engine of Seam, can reverse-engineer a database schema and generate a surprisingly functional web application automatically. This is both good and bad, of course: what we don't do ourselves we often don't clearly understand when it has outlived its usefulness. But it is a rush to see your data appear as though by magic on a screen. And seam-gen can be easily used from both NetBeans and Eclipse.
Part 2. Seam fundamentals
Chapter 3. The Seam life cycle
Seam steps in to support the developer concerned with the weaknesses of JSF, which are typically cases that depart from the simple HTTP request-and-response paradigm: redirects, navigation that depends upon context, and so forth. Seam handles these as close to effortlessly as could be managed, in part by participating in and adding to the JSF component life cycle. Whether it's intelligent navigation with an awareness of context, talking to EJBs, maintaining state across redirects, or one of the other deficiencies of JSF, Seam is typically there with an answer.
Chapter 4. Components and context
Context is all in Seam. The Seam context maintains variable values, injecting dependencies and retrieving values back to the context, looking up EJBs, maintaining persistence contexts (which all but eliminates those nasty LazyInitializationException messages), and so much more. The Seam context is where components are defined, initialized, and managed.
Chapter 5. The Seam component descriptor
Annotations are heavily used in Seam to avoid the use of XML descriptors where possible. But there are some things for which annotations (and possibly even Java code) are not the best solution, and Seam provides a great deal of functionality by way of configuration. This does require descent into the depths of XML, especially as Seam includes a number of built-in XML namespaces that help configure useful functionality from integration of email and user authentication to UI themes and persistence. Resource bundle management is another important feature of Seam descriptors.
Chapter 6. Absolute inversion of control
IoC and dependency injection (DI) is central to a number of important frameworks of late. Seam extends the idea of DI to include not only injection of values from the Seam context into an object when it is used (not only when it is created) but also out-jection of values from the object back into the Seam context once the operation has been performed (the combination is called bijection). This process is managed by method injectors that can, if needed, be disabled. Seam also allows the developer to raise events from components and pass those events to interested observers.
Part 3. Seam's state management
Chapter 7. The conversation: Seam's unit of work
One of the important additions of Seam to the management of user state is the concept of conversation. This is a scope, like the more familiar request and session scopes, but more long-lasting than the former and less so than the latter. Many use cases require interaction with a user over a series of pages; the conversation scope is perfect for holding state within such interactions. The user can even hold multiple conversations within different browser tabs or windows and Seam manages the lot! The developer also gets the benefit (over handling this with session variables) that Seam automatically cleans up after itself. Delineating conversation scope can be managed in the usual variety of ways.
Chapter 8. Understanding Java persistence
Seam supports both Hibernate, a mature object-relational management solution, and JPA, a rather newer but more standard one. Owing to Hibernate's relationship to JBoss, support for it is not too surprising; Hibernate also doubles as a JPA provider, so again support for it is unsurprising. Seam adds a special feature to the EntityManager in the latter, enabling it to remain open and available throughout the request to avoid issues with lazily initialized properties. In addition, because entities don't have to be detached, issues raised by merging can be completely avoided.
Chapter 9. Seam-managed persistence and transactions
The extended EntityManager does raise issues, however. Who opens it? Who closes it? What are the bounds of transactionality? All of these are issues Seam helps the developer to artfully handle. Transactionality is one area where Seam adds considerably to the defaults of Java EE, enabling separate transactions covering business logic and rendering-driven event handling. This avoids the all-too-frequently-encountered case where rendering errors might unexpectedly roll back successful business transactions. Seam also helps manage proper isolation and flushing of the persistence context.
Chapter 10. Rapid Seam development
Seam defines a subset of its classes (referred to in the text as a "framework within a framework") under the name Seam Application Framework. These classes taken together are the secret to Seam's being able to easily handle simple database applications. Learning to configure and use these is the subject of this chapter. Among the classes discussed are a number of extremely useful ones, including a Query component that is context-aware and can paginate effortlessly.
Part 4. Sinking the business requirements
Chapter 11. Securing Seam applications
You didn't really think that Seam was going to go this far and leave you high and dry as to user authentication and authorization, did you? Where JAAS stops and well before Acegi Security (now Spring Security) drops you into XML-land, Seam steps in. With the identity management module introduced in Seam 2.1, you can even manage most of the problem using annotations and configuration. Authorization in Seam is typically managed using roles assigned to users (even using Drools, the JBoss rules engine!) but roles can be adjusted if need be in specific use cases to allow users to do what they might not be able to otherwise.
Chapter 12. Ajax and JavaScript remoting
Chapter 13. File, rich rendering, and email support
Chapter 14. Managing the business process (online)
Chapter 15. Spring integration (online)
Appendix A. Seam starter setThis appendix helps you get started with Seam by detailing the tools you will need to begin working. Setting up the JDK, an application server, even Seam itself is covered. And Seam can even be used with Maven 2 or Ivy!
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)
Andy Pemberton replied on Tue, 2009/04/14 - 4:18pm
Christian Maslen replied on Tue, 2009/04/14 - 7:03pm
A comprehensive review and having also read the book a rating I agree with. Chapter 6 alone is worth the purchase price. For those not familiar with Seam I recomend checking it out and using this book to help you out.
Christian.
Roger Studner replied on Tue, 2009/04/14 - 7:09pm
I already own the book.. and wanted to comment.
This is an amazing book. Simple as that.
I've been a very long time Spring user (near evangelist)... and reading this book.. makes me wish I could work on a Seam project.
The tech/presentation is just awesome.
Jasen Jacobsen replied on Tue, 2009/04/14 - 8:33pm
Jesse Sightler replied on Tue, 2009/04/14 - 9:10pm
Hantsy Bai replied on Tue, 2009/04/14 - 10:14pm
Good book for learning Seam.
Álvaro Martínez replied on Wed, 2009/04/15 - 3:52am
Paul Slattery replied on Wed, 2009/04/15 - 3:56am
Great review , seems to follow the structure of the other 'In Action' series.
Looking forward to reading it.
P
Christian Voller replied on Wed, 2009/04/15 - 5:33am
Stanislav Poljovka replied on Wed, 2009/04/15 - 6:58am
I am sympathizer of Seam technology and I look forward to next step of this technology (JSR??? - WebBeans).
Marco Donati replied on Wed, 2009/04/15 - 8:41am
I agree with this revision.
"... The writing is extremely dense, communicating as tersely as possible. ...": Yes, it's true. The writing is extremely dense and careful. I've used this book in teaching phase, when you must learn Seam fundamentals, and later, when you must put a finish touch to your knowledge. Seam in Action save me from the labyrinth of "conversations"; however, Seam save me from the Java Enterprise problems.
My experience with Seam: i'm focusing to the model (without persistence worries) and to the web designs (using css templates). The rest: someone @ and someone {#} scattered here and there.
Zaheer Paracha replied on Thu, 2009/04/16 - 10:02am
Ram Kompella replied on Thu, 2009/04/16 - 10:23am
thanks for the nice review. Looks intersteing.
Is it just integration of different technologies or doesnt provide any added enhancements?
Is it worth learning SEAM? How is the market for Seam?
Shaji Ravindran replied on Fri, 2009/04/17 - 7:41am
Sudhakar Ramasamy replied on Sat, 2009/04/18 - 10:22pm
Sudhakar Ramasamy replied on Tue, 2009/04/21 - 6:17pm
Wei Ling Chen replied on Tue, 2009/04/28 - 9:48am
in response to:
Andy Pemberton
Hi guys,
Thanks for all the comments. I am proud to announce Andy (pembertona) is the winner for this book. Congratulations Andy. Check out other free book offers every week.
Thanks,
Wei Ling
shanshan gan replied on Fri, 2009/05/29 - 8:23am