0

I currently have following Architecture:

  • Managedbeans of all different scopes for Handling the View-Logic of xhtmls
  • and Singletons (public static methods) for Services/DAO...

Example:

public class UserDAO {
    public static void updateUser(UserModel user){
    ...
    }
}

in Session-/ViewScoped Managed bean then:

void someMethod(){
    UserDao.updateUser(user);
}

Is this the right way to build a multi-user JSF-Web-Application?

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?

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...

Can someone bring light into this?

Niko
  • 1,054
  • 5
  • 25
  • 52
  • Hi Balus. I don't think that its duplicate, because applicationscope is not mentioned once in the other topic. I just want to know it the way I access methods can cause problems in a multi user environment – Niko Jun 21 '16 at 08:16
  • The duplicate is your starting point. It shows the correct approach for this all and it has also a link to "How to choose the right bean scope?". – BalusC Jun 21 '16 at 11:12

0 Answers0