SEAM
Posted by mtwinkle on July 10, 2007
The two core concepts in Seam are the notion of a context and the notion of a component. Components are stateful objects, usually EJBs, and an instance of a component is associated with a context, and given a name in that context.
A conversation is a unit of work from the point of view of the user. It might span several interactions with the user, several requests, and several database transactions. But to the user, a conversation solves a single problem. For example, “book hotel”, “approve contract”, “create order” are all conversations.
A conversation holds state associated with “what the user is doing now, in this window”. A single user may have multiple conversations in progress at any point in time, usually in multiple windows. The conversation context allows us to ensure that state from the different conversations does not collide and cause bugs.
The business process context holds state associated with the long running business process. This state is managed and made persistent by the BPM engine
Application context is mainly useful for holding static information such as configuration data, reference data or metamodels. For example, Seam stores its own configuration and metamodel in the application context.
we obtain components from a context via injection, and put component instances into a context via outjection.
Almost all seam components need a name. We assign a name to a component using the @Name annotation: