Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

JSF : Component Binding Vs find component in the tree

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is better approach, component Binding or finding component in the component tree.
I am bit confused. Some where it is mentioned that component binding is more effecient as because, we dont need to find any component in the tree.

But I got some information from some JSF expert they dont recomend to have compoent binding as because the life cycle of managed bean and component tree is diffrent. that means if we used a component binding inside a manged bean, garbage collection of the component will depends on the managebean , as because component is referenced inside the managed bean , managed bean is having longer life than component inside a tree.
please advice.
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You start to think about optimization before your project has problems with it.

Although I prefer value binding I have code contexts that also use component binding. Use it if you need it or your design is more understandable with it. The quality in design, code readability and maintainability are more important in the long run.

The hardware will become cheaper during your project. So speed, memory usages and the like problems you may expect at the beginning of a project become less important with the better hardware quality at the end of your project ;-). A bad design will cost you more in the long run.
Saloon Keeper
Posts: 24331
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've seen component binding and listeners overused. I certainly wouldn't use them purely for efficiency's sake, since if there's that big a performance problem, I might end up re-engineering the offending part of the app to use non-JSF techniques and bypass the overhead that comes from setting up and tearing down a FacesContext and its friends.

The major selling point of JSF to me is that it allows creating webapps out of simple, reusable components in a fairly straightforward way. To employ complex or even convoluted specialized JSF features in those components would be defeating fully half the purpose. So I bind to values, do injections, and avoid listeners except when there's a good reason to do otherwise.
He was expelled for perverse baking experiments. This tiny ad is a model student:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic