title: How to share an entity between JSF backing beans?
body: <p>I would like to modularize my JSF 2.1 / Java EE application. I have a page that consists of several modules. Each module should use a separate JSF backing bean. Some of these modules need to show and change some data from/on the same entity.</p>
  
  <p>I've already tried some approaches but I am not satisfied so far. I ask myself what the best way to do this would be?</p>
  
  <p>All modules use the same entity and they (probably) need to notify the other backing beans if some data has changed.</p>
  
  <p>Comments to some approaches that I've already tried:</p>
  
  <ul>
  <li>Passing the entity to my component (XHTML) via interface will not pass it to the backing bean as well</li>
  <li>Loading the entity in the bean's postContruct method by reading an id from the request paramters is commonly discouraged in favour of using the "viewParam" approach</li>
  <li>Using "viewParam" is IMHO not as good as having the entity after bean creation (in my postConstruct). I'm not sure when the bean's setter is invoked.</li>
  </ul>