Business logic: EJB and OSGi declarative services

I know that EJB is the de facto standard in enterprise business logic applications. However, osgi declarative services can do many things that AJB does. Both are container-managed, both can be used as singleton, both can be used with CDI. The differences I found are as follows:

  • EJB already has an RMI engine, but no DS.
  • EJB has a thread pool but DS is not
  • DS may require only OSGi, but EJB requires a JavaEE container (for example, if we are developing a standalone application using a JavaEE container, it will be difficult. As this will result in either performance overhead or the need to extract the EJB container from the JavaEE implementation (exm glassfish) .

What are the other important benefits of EJB that explain its use as a standard?

EDIT:
The reason I asked this question is this: we want to develop some business logic that can be used for both the SE platform and EE. That's why DS seems like the best solution. However, EJB and DS are two universes, and we are afraid of losing something important.

+4
source share
3 answers

I spoke at Apachecon 2015 about OSGi enterprise applications. It mainly covers DS versus design, because Java EE support is not yet fully OSGi ready. Nevertheless, you should find the main options for using the enterprise and how to make them in DS.

. http://www.slideshare.net/ChristianSchneider3/osgi-productivity-compared-on-apache-karaf

+4

.

- , , , Java SE.

- Unit Test.

Java EE, OSGi. , .

EJB, ?

POJO , .

0

OSGi , EJB .

Seeing that your question is about using business logic in both the JEE application and Java SE, EJB sounds like the best option, especially considering that OSGi JEE support is not yet ready.

In fact, I would actually suggest using an ESB, such as mule or WSO2, and just have the business logic that will be shared on the server side extracted from your Java SE application.

-1
source

All Articles