I know that EJB is de facto standard in enterprise applications for business logic. However, osgi declarative services can do a lot of things which EJB do. Both are managed by container, both can be used as singleton, both can be used with CDI. The differences which I found are:
- EJB has already RMI mechanism but DS don't.
- EJB has thread pool but DS don't
- DS can require only OSGi but EJB requires JavaEE container (for example if we develop standalone application using JavaEE container will be difficult. Because it will either lead to performance overhead or to necessity to extract EJB container from JavaEE implementation (exm glassfish).
What are other important advantages of EJB explaining its using as standard?
EDIT:
The reason why I asked this question is the following - we want to develop some business logic which can be used both for SE and EE platform. That's why DS seem to be a better solution. However EJB and DS are two universes and we are afraid of missing something important.
@Referenceto anExecutorService, and you're done). Finally DS doesn't actually need to run on OSGi (though why wouldn't you?). - Neil Bartlett