0

I am starting a new project. This will be a Java EE web application. The application will consist of 3 parts, each one having different functionality, but they all belong to one application. I am thinking of using the following architecture:

There will be 4 separate projects (JSF web applications). The first one will be responsible for communication with database and will expose remote EJBs. Let's call the first project "DataLayerProject". The other 3 applications, which I have mentioned above, will consume the EJBs from the "DataLayerProject" in order to communicate with the database. They will represent the presentation layer of the application.

In my opinion this approach will allow to maintain and develop the 3 parts independently of each other. This will make the project more scalable (in case there will be need to add another sub-projects to the main application).

Is this is a viable solution?

Should I use REST services instead of remote EJBs. (Sorry if I am misunderstanding something here)?

There will be the main page from which I will access the other 3 parts. The question is that I need to have single sign on for every application. Thus, by logging in on the main page user is automatically gets logged in the other 3 applications.

Should I use any portal solutions for making the separate web applications work together?

2
  • I think it would be better to have RESTful services instead of remotes EJB for performance reasons, but that doesn't mean you can't have EJBs at all, check How to Combine REST Services with EJB 3.1. Commented Feb 8, 2013 at 4:39
  • RESTFul Vs EJBs : In REST case as it is purely depend http protocol, implementation requires less infrastructure plus provides additional portability. The thing we need to consider is how authentication and authorization to each service call. Commented Feb 8, 2013 at 10:21

1 Answer 1

2

If all your applications are deployed on a single server, then you can use local interfaces for EJBs instead of remote ones and that would be the fastest implementation.

Sign up to request clarification or add additional context in comments.

2 Comments

What if I will need to deploy the applications on different physical servers in order to distribute the load on the whole application?
I don't know of any performance benchmarks of remote EJB calls versus web-services. Using web-services has an overhead of transforming your data from Java objects to XML/JSON which you don't need to do if using EJBs. Also EJBs offers you an easier transaction management.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.