Components with multiple roles
Some Seam component classes can fulfill more than one role in the system. For example, we often have a User
class which is usually used as a session-scoped component representing the current user but is used in user administration screens as a conversation-scoped component. The @Role
annotation lets us define an additional named role for a component, with a different scope—it lets us bind the same component class to different context variables. (Any Seam component
instance
may be bound to multiple context variables, but this lets us do it at the class level, and take advantage of auto-instantiation.)