GeeCON Prague 2014*
The moose likes EJB and other Java EE Technologies and the fly likes EJB or web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB or web service" Watch "EJB or web service" New topic
Author

EJB or web service

sarah Marsh
Ranch Hand

Joined: Mar 06, 2001
Posts: 282
If all the code is in Java, how to decide if use web service or EJB?

Thanks!
sarah Marsh
Ranch Hand

Joined: Mar 06, 2001
Posts: 282
Any idea?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42061
    
  64
EJB and WS fulfill rather different roles. They don't compete with one another, but can complement each other. E.g., you might use a WS to expose the functionality of an EJB to another system or the outside world.

If you told us the details of the scenario you're thinking of, we might be better able to advise on which might be better suited.


Ping & DNS - my free Android networking tools app
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3710
    
    5

If you use the EJB all the code will be in java (both server and client). If you use Web Services, only the server will be in java, the client can be anything that will send/receive XML. Also, Web Services are generally considered to be slower since there's no way to avoid serializing/deserializing the objects (which some application servers can avoid with EJBs).
[ July 10, 2008: Message edited by: Scott Selikoff ]

My Blog: Down Home Country Coding with Scott Selikoff
 
GeeCON Prague 2014
 
subject: EJB or web service