Been trying to learn what EJB
beans are, what does it mean their instances are managed in a pool, blah blah. Really can\'t get a good grip of them.
Can you
The question that interests me most is how and where can I use them. To understand this, we need first to see what types of EJBs exist. There are 2 big categories:
Let's consider Session Beans. They are of 3 kinds:
OrderService
. Another big use for these is to expose web services. Again, this be in the Service layer or totally separate.Configuration
component comes to mind - where you can store application level configs and access them when you need them from anywhere.Now the rest of the capabilities or features can be used across layers in any such situations:
One big use in modern times are the so called Microservices and Service Oriented Architectures. You can package some business logic components as EJBs and distribute them across the organization, to be used by multiple clients (by client here I mean other back-end applications).
And so on. Now the big drawback is that you become very dependent on the EJB container and although you could switch between 2 reference implementations, you will not be able to switch to something lighter - Tomcat for example. But why would you want to sacrifice all the benefits?