论坛首页 Java企业应用论坛

JSF: Managed Bean VS. Backing Bean

浏览 2036 次
该帖已经被评为隐藏帖
作者 正文
   发表时间:2007-12-17   最后修改:2008-11-25
(Quoted from here)
Managed bean is about how the bean is created and initialized. As you know, jsf uses the lazy initialization model. It means that the bean in the particular scope is created and initialized not at the moment when the scope is started, but on-demand, i.e. when the bean is first time required.

Backing bean is about the role a particular managed bean plays. This is a role to be a server-side representation of the components located on the page. Usually, the backing beans have a request scope, but it is not a restriction.

If you use or try to work with Java Studio Creator, you can find the backing bean work more explicitly. The same for Shale, because it is designed by the same architect. Generally, it is not required by specification to bind all the components with the properties of the backing bean, so, on practice, the differentiation between the backing bean and managed bean is not evident. Sometimes people call all the beans like backing beans even they are just used for value binding. There is no a thumb rule here, just because the JSF specification has no explicit definition for those terms.[flash=200,200][/flash]
   发表时间:2007-12-21  
you are very strong,i don't read if difficlty!
0 请登录后投票
   发表时间:2007-12-21  
"because the JSF specification has no explicit definition for those terms", you may just treat the both as the same.

but from the book I read(JSF: The Complete Reference), I would like to take a bean as a becking bean when its properties are used to bind the UI components proper(not the values of them). and just as the post I quoted above, "becking bean is the role managed bean plays to be a server-side representation of the components located on the page".
0 请登录后投票
论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics