What would a stateless session bean provide over just a regular class that has the same methods? It seems that a stateful session bean can be distributed out of the box and the container will make sure that the state looks the same to clients anywhere. With a stateless session bean what is provided that you would not get with a normal class?
Is it just that your EJB tier can fail over if you have a distributed environment? It seems to me that you can get a local or remote instance of a stateless session bean, if I only use one server for my application and thus never use the remote interface is there any benefit?
EJBs give you declarative security, transactions and remoting. When you call one of the EJB's methods, you actually pass through a stack of interceptors that provide the above layers of functionality.
A Plain Old Java Object wouldn't do any of that. Of course, if you don't need any of that, then EJBs are not necessary.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With