• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Backing bean vs Managed bean

 
Pinal N Patel
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a difference between backing bean and managed bean? JSF in action implies they are the same thing. Please correct me if I am wrong.
Backing beans are usualy declared with the Managed Bean Creation facility in faces-config.xml.


I am guessing they are different.

Thanks for your response in advance.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They are the same thing.
 
Tim Holloway
Saloon Keeper
Posts: 18304
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if you want to get really pedantic, a "Managed Bean" is a bean constructed/initialized via injection in the faces-config.xml file. A "Backing Bean" is a bean referenced by JSF pages and is defined in the faces-config.xml file.

Few people will probably care about the difference. Usually if it's one, it's also the other.
 
Sergey Smirnov
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I answered this question several time ago. Please take a look at http://www.coderanch.com/t/211389/JSF/java/managed-backing-beans
 
Chandan Thour
Greenhorn
Posts: 1
Eclipse IDE Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Backing Bean and Managed Bean Analogy

Here’s a good analogy to help you remember the difference between backing and managed beans. A managed bean is like a backpack you use to carry your stuff when you go for a hike. You know how much your stuff weighs, so you carefully decide which items you want to put in the backpack and leave heavier items that you don’t really need at home. A backing bean that gets generated by JDeveloper is like a backpack packed by your partner. Because he or she doesn’t know what exactly you need for the trip—but he or she wants to make sure you have everything you need—everything goes into that backpack. You then must carry all that weight as you hike over the hills. Because generating a backing bean creates setter and getter methods for all components on a page, including those you don’t use in your Java programming, the backing bean backpack grows big and heavy. If you use managed beans instead, you are packing the bean backpack yourself with better control over its weight.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic