Part 2. Seam fundamentals – Seam in Action

Part 2. Seam fundamentals

Golf is challenging to players of all skill levels, but it’s especially unforgiving to beginners. If you expect to stop by the sporting goods store to pick up a set of clubs, a bag, and a collared shirt, then ride up to the first tee in your golf cart to begin your golfing career, you are in for a big surprise. So are the worms whose heads you try to take off on your first shot, which in golf lingo we call a “worm burner.” After barely breaching the boundaries of the tee box, you still have 300-plus yards to travel minus the benefit of using that little wooden tee.

To have a fighting chance at making it to the target, it’s essential that you learn the fundamentals of golf. Getting started with a new framework, like Seam, must be handled in the same manner. The prototype application you built in chapter 2 made you look good, but seam-gen carried you most of the way. Without a deeper knowledge of how Seam functions, you aren’t going to travel far from the starting point, nor will your application make it off the ground. It’s time to step back and take some lessons.

This part gives you a firm understanding of how Seam works. Chapter 3 provides insight into how Seam participates in each request and what Seam does to enhance the JSF life cycle. Seam’s essential offering, though, is its contextual component model, which you are introduced to in chapter 4. You learn how a component is born, what it means for a component to be contextual, and how you instantiate and access component instances. Seam encourages the use of annotations to define components, but also allows you to define them in XML, which is covered in chapter 5. You’ll discover how to initialize the properties of a component once it’s instantiated. With components and contexts down, chapter 6 explains how components interact and communicate through Seam’s two inversion of control mechanisms: bijection and events. After reading this part of the book, you’ll be perfectly comfortable extending a Seam application. You’ll feel empowered by the ease with which you can quickly define components, wire them together, bind them to JSF views, and have complete control over page requests.