In my recent client requirements, I need to develop one client api and one server api, where server api sits on weblogic server, and client api needs to access the server api to have the functioanlity of the application which is deployed in weblogic. client api may be used in other web application on diffrent servers or that may be accessed from any java stand alone applications.
I proposed three solutions to my client.
1. Server API made up of stateless session beans.
2. Web Services
3. Http Tunneling
I am have adviced client for plain EJB instead of webservices and http tunneling.
Can you please tell me whether there is other best solution to this ? is EJB only the best solution ?
You can use stateless session beans and deploy them as web services too. In this way you can have various clients (simple java clients, Servlets + JSP, other EJBs, CORBA clients, .NET ) accesing the beans through locval interface, RMI (with or without IIOP) or through web services depending on your needs.
Best regards, Mircea
I think EJB is the best initial choice. You other obvious choice is RMI, but frankly, EJB is easier to do than RMI for real systems. With RMI, you have to manage a lot of application feature yourself (multi-threading, security, etc.)
You should be careful to make sure you have a reasonable EJB architecture. In particular, make sure you use the Session Facade and Data Transfer Object (aka Value Object) patterns. As Mircea said, this will make it easy to turn your Session EJB into a web service if it turns out you need that kind of access.
One final thing: just because you are using EJB does not mean you need to use Entity EJB. A lot of the problems people have with the EJB framework have to do with the way Entity EJB work. You should consider alternate persistance mechanisms like pure JDBC, JDO or Hibernate.