• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

managed -and backing beans question.

 
manuel aldana
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

here some uncertainties from my side:

backing beans are related (->as model) to the components in a jsf-page (like swing beans). Does it mean, that per control and site(e.g. <h:inputText .../> in bla.jsp) there exists one instance of a backing-bean, i.e. all jsp-tags (core&html) refer to one node in an ui-component tree of a site?

it is not clear too, how the relation between backing beans and managed beans is meant. managed beans are "self"-written beans to tie my web-application to the business-tier (of course they should not themselves be business-objects). backing-beans are related to managed beans in that way, that backing-beans are somehow the glue to read/write the values of my forms to my managed beans.

i am a bit confused because some sites mention, that managed beans ARE backing beans.

thnx!
 
Sergey Smirnov
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vice versa. The backing bean is a managed bean.

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.

--
Sergey : http://jsfTutorials.net
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic