JavaOne 2008 - Introduction to Web Beans
May 8, 2008 7:00 am JavaThe session “Introduction to Web Beans” was presented by Gavin King of Hibernate.
Web Beans provide a unifying component model for the Java EE platform by defining a program model compatible with EJB 3.0 and an extensible context model. EJB 3.0 beans can be turned into web beans simply by adding annotations. The same applies for JSF beans. Web beans represent a loose coupling but a strong typing, and they unify the web tier with the enterprise tier.
A web bean can be any Java class, an EJB session bean, resolver methods, JMS components, or remote components. They include a depolyment type, an API type, binding type, and a name.
A binding type is an annotation that lets the client choose between multiple API implementations.
A deployment type is an annotation that identifies a class as a deployed web bean that can be either enabled or disabled. Deployment type also specifies precedence, and replaces verbose XML configuration.
Web beans can also specify scope and context through the use of annotations. The built in scopes include @RequestScoped, @SessionScoped, @ApplicationScoped, and for JSF @ConversationScoped
Web beans are only available in Java EE 6 which is probably two years from market saturation. In my opinion, this technology is a “wait and see”.
