What is EJB, and why we should use it? Please explain in simple language. Thank you.
Benefits of EJB EJB simplifies the development of small and large enterprise applications. The EJB container provides system-level services to enterprise beans, the bean developer can just concentrate on developing logic to solve business problems.
EJB is still there and growing up. There are many new features (SOAP/RESTful webservice, JPA entities, JAXB...) depend on it or at least reuse the philosophy of developing.
Basic Difference Between the Two. First, the fundamental and apparent difference is that EJB is a specification, whereas Spring is an entire framework. The specification is implemented by many application servers such as GlassFish, IBM WebSphere and JBoss/WildFly.
The EJB or Enterprise Java Beans are plain java classes (since version 3.0) with annotations that enable to you write the business logic of your applications and later deploy it (or install) on a Java Enterprise Edition Server.
You must consider use EJB if you wish to take advantage of the following services provided by the Java Enterprise Edition (Java EE) server:
There is other services and benefits but I think that these are the most importants. If you don't need these benefits my recommendation is that you don't use EJB (not all applications are Enterprise Applications).
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