<div class="gmail_quote">On Fri, Jan 1, 2010 at 11:32 AM, Gavin King <span dir="ltr"><<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Yes, unfortunately there are two @ManagedBean annotations in EE6,<br>
neither of which are especially useful when you're using CDI. I<br>
personally argued against having either of them, but my view was not<br>
adopted.<br>
<br>
I hope we "prune" the whole javax.faces.bean package out of EE7.<br></blockquote><div><br>Just before the holiday break, we had a long conversation about this topic on the JSR-314 mailinglist. Everyone who responded agreed with this motion, so informally, you have the approval from the JSR-314 EG.<br>
<br>In that discussion, we came to the following conclusions:<br><br>For your programming model, use <span class="il">CDI</span> (platform
managed beans) or provide your own alternative bean container, such as
Spring. We (JSR-314) are in the business of creating a UI component model, not a programming model.<br><br>What we all agree on (including the Spring guys) is what we don't recommend, the JSF managed bean
container. What we can both get behind is a common set of annotations
to hook into stronger bean containers such platform managed beans + <span class="il">CDI</span> or platform managed bean annotations with Spring. @javax.inject.Named + @javax.inject.Inject, hoping for some common ground with the scope annotations.<br>
<br>With regard to the last comment, we could almost come to an agreement on the EG about how to show "managed beans" in JSF examples that was neutral to CDI and Spring, except for the scope annotations. Jeremy asked why there wasn't alignment on the scope annotations. Why can't we have just one platform-wide RequestScoped, SessionScoped and ApplicationScoped annotations? I couldn't completely answer his question.<br>
<br>Understand that my motivation here is to be able to show a JSF "managed bean" class that uses annotations that we can all get behind, so that we can stop using javax.faces.* in documentation (and be diplomatic).<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
However, note that @javax.annotation.ManagedBean is *already*<br>
integrated with CDI, since we say:<br>
<br>
"A top-level Java class is a managed bean if it is defined to be a<br>
managed bean by any other Java EE specification, or if it meets all of<br>
the following conditions..."<br></blockquote><div><br>Yep. What I've been saying is that this annotation should really be a formality that the end developer should never see because CDI is more or less applying it transparently (or implying it is there).<br>
<br>Btw, the name attribute on @javax.annotation.ManagedBean is practically useless. No reasonable developer is going to go looking into JNDI to find beans. Again, another low-level detail.<br><br>-Dan<br></div></div><br>
-- <br>Dan Allen<br>Senior Software Engineer, Red Hat | Author of Seam in Action<br>Registered Linux User #231597<br><br><a href="http://mojavelinux.com">http://mojavelinux.com</a><br><a href="http://mojavelinux.com/seaminaction">http://mojavelinux.com/seaminaction</a><br>
<a href="http://www.google.com/profiles/dan.j.allen">http://www.google.com/profiles/dan.j.allen</a><br>