title: JSF Singleton Services/DAO/.. vs ApplicationScope
body: <p>I currently have following Architecture:</p>
  
  <ul>
  <li>Managedbeans of all different scopes for Handling the View-Logic of
  xhtmls</li>
  <li>and Singletons (public static methods) for Services/DAO...</li>
  </ul>
  
  <p>Example:</p>
  
  <pre><code>public class UserDAO {
      public static void updateUser(UserModel user){
      ...
      }
  }
  </code></pre>
  
  <p>in Session-/ViewScoped Managed bean then:</p>
  
  <pre><code>void someMethod(){
      UserDao.updateUser(user);
  }
  </code></pre>
  
  <p>Is this the right way to build a multi-user JSF-Web-Application? </p>
  
  <p>I have read that some put all business logic into a @ApplicationScoped, and some say thats not the right way. I am wondering, if Singletons can cause concurrency-issues?</p>
  
  <p>As I have all Business logic in an own "Framework"-Project encapsuled (which is just a plain java-project which is used by some other apps in the same context as well) I can't just wrap Scoping-JSF-Logic around the services/Daos...</p>
  
  <p>Can someone bring light into this?</p>