Session beans encapsulate business logic for enterprise applications. It is a good idea to use session beans when developing enterprise applications, since we (as application developers) can focus on developing business logic without worrying about other enterprise application requirements such as scalability, security, transactions, and so on.
Note
Even though we don't directly implement common enterprise application requirements such as transactions and security, we can configure these services via annotations.
There are three types of session beans: stateless session beans, stateful session beans, and singleton session beans. Stateful session beans maintain conversational state with their client between method invocations, where stateless session beans do not. There exists only one instance of a singleton session bean in an application, whereas several instances are created by the application server for stateless and stateful session beans.