EJB is Enterprise Java Bean.
it is a technology that helps us to manage the server-side component architecture .
It helps us to maintain a modular construction for an enterprise applications.
Before you understand the term "modular construction" you may need to understand what the enterprise application means,and why make it different from web application.
An application that is accessed over a network such as internet for a specific purpose .
The users are mostly many and will have similar operation to do on the application.
In short : many user for one application
Example : gmail,facebook..
Its an application that is owned by an organization to automate their business process.
Usually the users are few but they may need to do different operation on the application
An organization has different departments like production,marketing,sales,accounts,logistics,service
Where the need of the application differs for each department but they are interlinked (output of one may be input of the other...)
Enterprise application has different layers or modules for each purpose/department.
Production department may need to maintain the stock details,done goods,returned goods,etc
sales department may need to maintain the sales details and the should be made available of the production detail.
account department may need to maintain the expense of the production department and the income in the sales department
And so on... with the other departments
In short : few user for many application
so the modules are linked to each other to carry out the business process..
And here comes "modular construction"..
Constructing an application with different modules with less dependency and sharing the precise information among them is modular construction.
Well being said that where does the EJB comes in here???
When its an web application the risk is less..
But when it comes to enterprise application risk is high since it carries out a business process of an organization.
1) It has different departments and they need to share information which is confidential..
so security is important which the information is being communicated
2) Output of the one department is the input of the other department
So when the output of one is wrong then all the other process of the other department is lost.
For which the accuracy is important
3) Since their are different modules in enterprise applicaton we may find difficult to deploy all of them in one server. To reduce the complexity we deploy in different server.
one process may need to use the process of a remote module
So the need for the web service and Remote procedure calls using RMI-IIOP comes in.
4) While the information is being transferred from one module to the other(may be server to server) if the server gets crashes then the values are lost. Since the values would be in RAM which is volatile(loses the data when the power is gone)
So need of Integration with the Persistence services offered by the Java Persistence API (JPA)
Likewise there are many other risk factors that begins to threat when we land to a enterprise application
The EJB (Enterprise JavaBean) has a complete solutions to overcome all those risk factors.
So to conclude EJB is a technology for enterprise application which helps in automating a business process of an Enterprise(Organization) with minimal threats..
Note*:I ve just shared my understanding about the topic. If i am wrong on some concepts. Please let me know so that i may correct it.