Gavin has posted 1 posts at DZone. View Full User Profile

Web Beans Public Review Draft Released

11.05.2008
| 2483 views |
  • submit to reddit
Location: 
http://in.relation.to/Bloggers/WebBeansPublicReviewDraftReleased

The Web Beans (JSR-299) specification is now available for public review.

Web Beans defines a set of services for the Java EE environment that makes applications much easier to develop. Web Beans layers an enhanced lifecycle and interaction model over existing Java component types including JavaBeans and Enterprise Java Beans. As a complement to the traditional Java EE programming model, the Web Beans services provide:

  • an improved lifecycle for stateful components, bound to well-defined contexts,
  • a typesafe approach to dependency injection,
  • interaction via an event notification facility, and
  • a better approach to binding interceptors to components, along with a new kind of interceptor, called a decorator, that is more appropriate for use in solving business problems.

Web Beans is especially useful in the context of web applications, but is applicable to many different kinds of applications and may even be used in the Java SE context, in conjunction with an embeddable EJB Lite container, as defined in the EJB 3.1 specification.

The Web Beans public draft is available in PDF or HTML format at:

   http://docs.jboss.org/webbeans/spec/PDR/pdf/Web%20Beans%2020081029.pdf
   http://docs.jboss.org/webbeans/spec/PDR/html/

or from:

   http://jcp.org/en/jsr/detail?id=299

Please send feedback on the public draft to:

   jsr-299-comments@jcp.org

An even easier way to learn about Web Beans is the Introduction to Web Beans guide available in PDF or HTML format here:

   http://docs.jboss.org/webbeans/reference/1.0/en-US/pdf/guide.pdf
   http://docs.jboss.org/webbeans/reference/1.0/en-US/html/

The Web Beans Reference Implementation and Compatibility Test Suite are being developed at:

   http://www.seamframework.org/WebBeans

This is a great time to get involved!

0
Published at DZone with permission of its author, Gavin King.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Tags:

Comments

Jose Maria Arranz replied on Wed, 2008/11/05 - 9:00am

I think WebBeans tries to simplify development of web applications based on page navigation, that is fine, but when the One Single Web Page approach (a.k.a Single Page Interface) goes to mainstream will become obsolete anytime soon.

 

Gavin King replied on Wed, 2008/11/05 - 10:25am

Web Beans has nothing to do with page navigation or anything like that. That's the job of a web framework, and web beans is not a web framework. Web Beans defines how server-side objects integrate with web-related contexts. A "One Single Web Page approach" still has request, session, application and conversation contexts. And it still has server-side business components that retrieve data and update the database, etc. Depending upon how "fat" the client is, there might be somewhat more business logic in the client in a "One Single Web Page approach, but at the end of the day the database is still on the server side, as is any business logic that must be performed securely.

Jose Maria Arranz replied on Thu, 2008/11/06 - 3:01am

Gavin King: A "One Single Web Page approach" still has request, session, application and conversation contexts

No. Only "request" and "application" contexts are useful (and as you know the "application" context is never used). Session and conversation contexts are not useful because there is no page navigation and both are tipically used to coordinate/share data between pages. In OSWP approach a new context, the "page" context, would be useful but missing in WebBeans.

 

 

Jose Maria Arranz replied on Thu, 2008/11/06 - 3:07am

Correction: "and as you know the "application" context is never used" correct "never" with "not very useful" or "not very important".

 

Gavin King replied on Thu, 2008/11/06 - 10:40am in response to: Jose Maria Arranz

[quote=jmarranz]

Gavin King: A "One Single Web Page approach" still has request, session, application and conversation contexts

No. Only "request" and "application" contexts are useful (and as you know the "application" context is never used). Session and conversation contexts are not useful because there is no page navigation and both are tipically used to coordinate/share data between pages. In OSWP approach a new context, the "page" context, would be useful but missing in WebBeans.[/quote]

 

This is just not correct. The session context models state that is specific to a certain user (for example, the user's login, permissions, etc). The conversation context models state that is specific to a particular task that the user is working on. Both of these constructs are every bit as meaningful if you take away page navigation: you still have multiple users, and they still want to do multiple things at the same time (multitask). In fact, the "page" context you describe actually *is* a conversation context. And even if it wasn't, Web Beans has an *extensible* context model, so the framework you are using can add its own @PageScoped context. But actually what it should do is add an implementation of the @ConversationScoped context.

 Now let's consider what happens if you have a "OSWP" application that does a whole bunch of async requests to the server for data and you *don't* have a conversation (page, if you prefer) context. Then ever one of those requests is probably going to require re-loading data from the database that we have already loaded. You're going to kill your database. Synchronizing object graphs between the client and database server is a very tricky problem in these kinds of architectures, with many performance traps. ORM solutions like Hibernate can *help*, but they can help much more if they can keep their state between async requests.

Jose Maria Arranz replied on Thu, 2008/11/06 - 3:15pm

Umm as far as I know the conversation context is designed to coordinate pageS (including reload), can the "page" context be adapted as a conversation context? I don't know.

Gavin: Now let's consider what happens if you have a "OSWP" application that does a whole bunch of async requests to the server for data and you *don't* have a conversation (page, if you prefer) context.

Yes course, this is the reason I'm talking about WebBeans (apparently) ignores the OSWP approach, a "page" context is a BASIC piece in this scenario.

 

 

Gavin King replied on Thu, 2008/11/06 - 4:34pm in response to: Jose Maria Arranz

[quote=jmarranz]Umm as far as I know the conversation context is designed to coordinate pageS (including reload), can the "page" context be adapted as a conversation context? I don't know.[/quote]

As far as I know the conversation context has nothing to do with "coordinating pages". And I'm the Web Beans spec lead, so it's kinda my job to know ;-)

Yes, the "page context" is just a kind of conversation context.

[quote=jmarranz]Gavin: Now let's consider what happens if you have a "OSWP" application that does a whole bunch of async requests to the server for data and you *don't* have a conversation (page, if you prefer) context.

Yes course, this is the reason I'm talking about WebBeans (apparently) ignores the OSWP approach, a "page" context is a BASIC piece in this scenario.[/quote]

 Then you'll be very happy to know that we have it covered in Web Beans ;-)

 

 

[/quote]

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.