Types of Beans
Duration: 3 min
This video lesson is available to enrolled students.
Enroll to watch — UP LT Grade Assistant Teacher 2025 Computer Science Course
AI summary & chapters
AI Summary
An AI-generated summary of this video lecture.
This lecture provides an overview of the three primary types of Enterprise Java Beans (EJB): Session Beans, Message Driven Beans, and Entity Beans. The instructor defines Session Beans as components containing business logic invoked by local, remote, or web service clients. The category is subdivided into Stateful and Stateless types. The lecture transitions to Message Driven Beans, explaining their invocation via messages, and concludes with Entity Beans, noting their deprecation in favor of JPA.
Chapters
0:00 – 2:00 00:00-02:00
The session begins with a slide titled "Types of Enterprise Java Beans," highlighting "1. Session Bean." The text defines these beans as containing business logic invoked by various clients. The instructor focuses on "(i) Stateful Session bean." The slide explains that these beans perform business tasks using a state, storing information in instance variables to maintain data across separate method calls. An example is provided: a shopping site where items chosen by a customer must be stored as data, illustrating the need for state retention. A hierarchy diagram shows "Enterprise JavaBean" branching into "Session Bean," "Entity Bean," and "Message Driven Bean."
2:00 – 3:10 02:00-03:10
The lecture moves to "(ii) Stateless Session bean," defined as implementing business logic without persistent storage mechanisms like a state or database, often using shared data. The instructor draws a rough diagram labeled "web" and "prc" to illustrate processing. Next, "2. Message Driven Bean" is introduced, described as similar to Session Beans but invoked by passing a message. The instructor writes "Email notification" as an example. Finally, "3. Entity Bean" is discussed. The slide notes it summarizes state remaining in the database but is deprecated, replaced by JPA. Two persistence types are listed: "Bean Managed Persistence," where the programmer writes database code, and "Container Managed Persistence," where the container handles database calls. The instructor annotates the slide with "Deprecat" and "Database."
The lecture breaks down the EJB architecture, starting with Session Beans. It distinguishes between Stateful beans, which retain client-specific state like a shopping cart, and Stateless beans, which do not. The discussion shifts to Message Driven Beans, which handle asynchronous messaging tasks like email notifications. The final section covers Entity Beans, clarifying that while they manage database state, they are deprecated in modern Java development, superseded by JPA. The distinction between Bean Managed and Container Managed Persistence is highlighted as a key technical detail for understanding legacy EJB implementations.