Topic 6: Enterprise JavaBean (EJB) components - zhamri/CSC584-Enterprise_Programming GitHub Wiki
Goal
To introduce students to Enterprise JavaBeans (EJB) as server-side components used to manage business logic in enterprise applications.
🎯 Learning Objectives
Students should be able to:
- Explain the concept of JavaBeans and Enterprise JavaBean (EJB)
- Differentiate between JavaBean and EJB
- Describe the types of EJB (Session, Entity, Message-Driven)
- Understand the role of EJB in enterprise architecture
- Apply simple JavaBean concepts in web applications
📌 Topics to Cover
- Introduction to JavaBean
- What is a JavaBean
- Properties (getter & setter)
- Naming conventions
- JavaBean in Web Applications
- Using JavaBeans with JSP
- Passing data between components
- Introduction to EJB
- What is EJB
- Why use EJB in enterprise systems
- Types of EJB
Session Bean(business logic)Entity Bean(database representation – concept only)Message-Driven Bean(MDB) (asynchronous processing – concept only)
- EJB in Architecture
- Placement in multi-tier architecture
- Integration with Servlet and JSP
🛠️ Hands-on Activity (Tutorial)
Activity: Using JavaBeans in Student Management System
Students are required to:
1. Create JavaBean Class
Example: Student.java
Attributes:
- name
- program
Include:
- Getter and Setter methods
2. Use JavaBeans in Servlet
- Create object:
Student s = new Student();
- Set values:
s.setName(name);
- Pass to JSP:
request.setAttribute("student", s);
3. Display in JSP
- Access using Expression Language:
${student.name}
${student.email}
${student.program}
4. (Conceptual EJB Understanding)
- Students explain:
- Where a Session Bean would be used
- Where MDB might be used (e.g., email notification system)
Expected Output
Students should produce:
- JavaBean class (Student.java)
- Updated Servlet
- JSP page displaying object data
- Simple explanation of EJB types
📚 Suggested Readings
- Oracle JavaBeans Tutorial https://docs.oracle.com/javase/tutorial/javabeans/
- Introduction to EJB https://jakarta.ee/learn/docs/jakartaee-tutorial/current/entbeans/ejb-intro/ejb-intro.html
- https://en.wikipedia.org/wiki/Jakarta_Enterprise_Beans
- https://www.tutorialspoint.com/ejb/ejb_overview.htm
- https://www.geeksforgeeks.org/java/enterprise-java-beans-ejb/
- https://medium.com/@upadhyay068/everything-you-need-to-know-about-enterprise-javabeans-ejb-features-types-and-rmi-9c8da700e86a