[jsr-314-open] getting behind CDI
Cay Horstmann
cay at horstmann.com
Sat Jan 16 10:56:10 EST 2010
It seems so long ago that we had this discussion :-)
I thought you might find it interesting that the Java EE tutorial does
just what Dan asked for: They use @Named, not @ManagedBean, in their
published examples. Look at
http://java.sun.com/javaee/6/docs/tutorial/doc/gjcxv.html and search for
"managed bean".
Cheers,
Cay
On 12/17/2009 08:23 AM, Dan Allen wrote:
> I'm going to venture out onto a limb here in hopes of leveraging the
> influence of your professional recommendations. I ask that you read
> through this message with an open, forward-looking mind.
>
> I feel strongly that, as a group, we should provide a consistent
> recommendation regarding the programming model of JSF by getting behind
> CDI.
..
> Showing users how to use @ManagedBean on a class and inject other
> managed beans with @ManagedProperty or an EJB with @EJB is showing
> developers only a portion of the value of this platform's programming
> model. We want to put our best foot forward. That's why we show
> composite components in presentations and not how to create a components
> in Java. We show Facelets, not JSP. We want to make it seem as easy as
> it can be.
>
> Rather than recommending:
>
> @ManagedBean
> @RequestScoped
> public class BlogEditor {
> @ManagedProperty("#{blogDao}") BlogDao blogDao;
> // getters and setters required
> }
>
> We want to show them:
>
> @Named
> @RequestScoped
> public class BlogEditor {
> @Inject BlogDao blogDao;
> }
--
Cay S. Horstmann | http://horstmann.com | mailto:cay at horstmann.com
More information about the jsr-314-open-mirror
mailing list