SlideShare a Scribd company logo
MyExamCloud
© EPractize Labs Software. All rights reserved
Presentation by MyExamCloud
Introduction to Java EE EJB Component
MyExamCloud
Introduction to Java EE EJB Component
This presentation deeply discusses the usage of EJB component in Java EE architecture.
Before start reading about EJB, it is advisable to understand the history behind
component-container architecture.
Introduction
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
The WWW technology is moved from 2 tier to 3 tier, 3 tier to n-tier and now n-tier to
SOA based solutions for easy integration and maintenance.
Evolution of Component-Container Architecture
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Single Tier
Mainframe based systems where presentation, business logic and database are on
same node.
Evolution of Component-Container Architecture
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Two-Tier
Client-Server model where presentation logic is moved to client machine.
Evolution of Component-Container Architecture
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Three-Tier
Introducing browser based applications where web server will handle all requests.
Presentation, Business Logic and Database are separated.
Evolution of Component-Container Architecture
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
N-Tier
Introducing component-container approach with application server to run business
logic components. Presentation, Business Logic, Integration (Data/Legacy) and
Database.
Evolution of Component-Container Architecture
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
SOA
Service Oriented Architecture to interact with other systems. Both WSDL based SOAP or
JSON based web services are getting more popular in current trend.
Evolution of Component-Container Architecture
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Normally, in N-Tiered applications we need to handle transaction and state management, multi-
threading, resource pooling, and other complex low-level services. The component-based and platform-
independent Java EE architecture simplifies these services with the help of containers. We just need to
write business logic and it is organized into reusable components.
The Java EE server provides underlying services in the form of a container for every component type.
Because we do not have to develop these services, we are free to concentrate on solving the business
problem at hand.
Java EE Containers
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
EJB is a component to write business logic in an enterprise application and it runs inside a container
named EJB container. The typical Java EE application server architecture is shown below:
Introducing EJB Component
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
The run-time portion of a Java EE product. A Java EE application server provides EJB and Web
containers.
Java EE Application Server
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Manages the execution of EJBs for Java EE applications. Enterprise beans and their container run on the
Java EE application server.
Enterprise JavaBeans (EJB) container
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Manages the execution of JSP page and servlet components for Java EE applications. Web components
and their container run on the Java EE application server.
Web container
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Manages the execution of application client components. Application clients and their container run on
the client.
Application client container
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Java EE provides the following EJB components.
1. Stateful Session Bean
2. Stateless Session Bean
3. Singleton Session Bean
4. Message Driven Bean
Note that Singleton bean is under session type introduced in Java EE 6.
EJB Components
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Using Stateless Session Beans
You are developing a business component where it does not contain the data for a specific client. Your
search component will be a best example for this scenario. Note that search requires only one method
invocation with search query among all the clients to perform the generic task (executing search query
on server side).
Example: Google search, Yahoo search and MSN search.
The following contents are taken from Oracle:
When to use Stateful Session Bean:
If the bean does not contain the data for a specific client.
If there is only one method invocation among all the clients to perform the generic task.
EJB Design Decision
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Using Stateful Session Beans
You are developing a business component where it wants to hold information about the client across
method invocation. The most common example for this type of implementation would be “Shopping
Cart”, where it needs to hold client specific information.
Example: Gmail, Yahoo Mail and Facebook.
The following contents are taken from Oracle:
When to use Stateful Session Bean:
What the bean wants to holds information about the client across method invocation.
When the bean works as the mediator between the client and the other component of the application.
When the bean have to manage the workflow of several other enterprise beans.
EJB Design Decision
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Using Singleton Session Beans
You can easily decide by the name itself, when you want to have exactly one instance of a session bean
go for Singleton session bean. You are developing an application where you want to have some
configuration parameters needs to be used across different modules and they needs to be available
during your server startup. You can easily implement this scenario by using Singleton Session bean.
The following contents are taken from Oracle:
When to use Singleton Session Bean:
State needs to be shared across the application.
A single enterprise bean needs to be accessed by multiple threads concurrently.
The application needs an enterprise bean to perform tasks upon application startup and shutdown.
The bean implements a web service.
EJB Design Decision
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
Using Message Driven Beans
Unless like regular Java method calls MDBs are called asynchronously without blocking. Note that Java
EE 6. Note that Session beans allow you to send JMS messages and to receive them synchronously but
not asynchronously. To avoid tying up server resources, do not to use blocking synchronous receives in
a server-side component; in general, JMS messages should not be sent or received synchronously. To
receive messages asynchronously, we should use a message-driven bean.
EJB Design Decision
© EPractize Labs Software. All rights reserved
MyExamCloud
Introduction to Java EE EJB Component
One better way to study EJB is by taking Oracle’s Java EE 7 Developer Certification.
Prepare for your Java EE 7 Application Developer Certification using MyExamCloud course:
https://www.myexamcloud.com/onlineexam/1z0-900-mock-exams-ocp-java-ee-aplication-developer.course
Java EE 7 Developer Certification
© EPractize Labs Software. All rights reserved

More Related Content

PPT
Unite5-EJB-2019.ppt
PPT
PPT
ADVANCED JAVA MODULE I & II.ppt
PPT
Aravind vinnakota ejb_architecture
PDF
Enterprise Java Beans - EJB
PDF
Ejb intro
PDF
Lecture 8 Enterprise Java Beans (EJB)
PDF
Introcution to EJB
Unite5-EJB-2019.ppt
ADVANCED JAVA MODULE I & II.ppt
Aravind vinnakota ejb_architecture
Enterprise Java Beans - EJB
Ejb intro
Lecture 8 Enterprise Java Beans (EJB)
Introcution to EJB

Similar to Introduction to Java EE EJB Component (20)

PPT
J2EEFeb11 (1).ppt
PPT
J2EEFeb11.ppt
PPT
EJBDetailsFeb25.ppt
PDF
EJB 3.0 - Yet Another Introduction
PDF
S314168 - What's New in Enterprise Java Bean Technology @ JavaOne Brazil 2010
PPTX
Enterprise beans
PPT
Ejb (1)
PPT
Ejb training institute in navi-mumbai
PPTX
The Latest in Enterprise JavaBeans Technology
PPTX
UNIT 4.pptx
PPT
ejb.ppt java lecture notes enterprise java
PDF
Ejb intro
PDF
Free EJB Tutorial | VirtualNuggets
PDF
Ejb 2 0 Development with Websphere Studio Application Developer 1st ed Editio...
PPTX
Java bean
DOCX
J2 ee tutorial ejb
PPTX
J2ee web services(overview)
PDF
What's New in Enterprise JavaBean Technology ?
PPT
EJB.ppthckhkhohjpfuysfzhxjvkgur6eydgdcjjggjj
J2EEFeb11 (1).ppt
J2EEFeb11.ppt
EJBDetailsFeb25.ppt
EJB 3.0 - Yet Another Introduction
S314168 - What's New in Enterprise Java Bean Technology @ JavaOne Brazil 2010
Enterprise beans
Ejb (1)
Ejb training institute in navi-mumbai
The Latest in Enterprise JavaBeans Technology
UNIT 4.pptx
ejb.ppt java lecture notes enterprise java
Ejb intro
Free EJB Tutorial | VirtualNuggets
Ejb 2 0 Development with Websphere Studio Application Developer 1st ed Editio...
Java bean
J2 ee tutorial ejb
J2ee web services(overview)
What's New in Enterprise JavaBean Technology ?
EJB.ppthckhkhohjpfuysfzhxjvkgur6eydgdcjjggjj
Ad

Recently uploaded (20)

PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
medical staffing services at VALiNTRY
PPTX
history of c programming in notes for students .pptx
PDF
System and Network Administraation Chapter 3
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Transform Your Business with a Software ERP System
PPTX
L1 - Introduction to python Backend.pptx
PPT
Introduction Database Management System for Course Database
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Designing Intelligence for the Shop Floor.pdf
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Understanding Forklifts - TECH EHS Solution
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Design an Analysis of Algorithms I-SECS-1021-03
Which alternative to Crystal Reports is best for small or large businesses.pdf
medical staffing services at VALiNTRY
history of c programming in notes for students .pptx
System and Network Administraation Chapter 3
Adobe Illustrator 28.6 Crack My Vision of Vector Design
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Odoo Companies in India – Driving Business Transformation.pdf
Transform Your Business with a Software ERP System
L1 - Introduction to python Backend.pptx
Introduction Database Management System for Course Database
PTS Company Brochure 2025 (1).pdf.......
Designing Intelligence for the Shop Floor.pdf
CHAPTER 2 - PM Management and IT Context
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Ad

Introduction to Java EE EJB Component

  • 1. MyExamCloud © EPractize Labs Software. All rights reserved Presentation by MyExamCloud Introduction to Java EE EJB Component
  • 2. MyExamCloud Introduction to Java EE EJB Component This presentation deeply discusses the usage of EJB component in Java EE architecture. Before start reading about EJB, it is advisable to understand the history behind component-container architecture. Introduction © EPractize Labs Software. All rights reserved
  • 3. MyExamCloud Introduction to Java EE EJB Component The WWW technology is moved from 2 tier to 3 tier, 3 tier to n-tier and now n-tier to SOA based solutions for easy integration and maintenance. Evolution of Component-Container Architecture © EPractize Labs Software. All rights reserved
  • 4. MyExamCloud Introduction to Java EE EJB Component Single Tier Mainframe based systems where presentation, business logic and database are on same node. Evolution of Component-Container Architecture © EPractize Labs Software. All rights reserved
  • 5. MyExamCloud Introduction to Java EE EJB Component Two-Tier Client-Server model where presentation logic is moved to client machine. Evolution of Component-Container Architecture © EPractize Labs Software. All rights reserved
  • 6. MyExamCloud Introduction to Java EE EJB Component Three-Tier Introducing browser based applications where web server will handle all requests. Presentation, Business Logic and Database are separated. Evolution of Component-Container Architecture © EPractize Labs Software. All rights reserved
  • 7. MyExamCloud Introduction to Java EE EJB Component N-Tier Introducing component-container approach with application server to run business logic components. Presentation, Business Logic, Integration (Data/Legacy) and Database. Evolution of Component-Container Architecture © EPractize Labs Software. All rights reserved
  • 8. MyExamCloud Introduction to Java EE EJB Component SOA Service Oriented Architecture to interact with other systems. Both WSDL based SOAP or JSON based web services are getting more popular in current trend. Evolution of Component-Container Architecture © EPractize Labs Software. All rights reserved
  • 9. MyExamCloud Introduction to Java EE EJB Component Normally, in N-Tiered applications we need to handle transaction and state management, multi- threading, resource pooling, and other complex low-level services. The component-based and platform- independent Java EE architecture simplifies these services with the help of containers. We just need to write business logic and it is organized into reusable components. The Java EE server provides underlying services in the form of a container for every component type. Because we do not have to develop these services, we are free to concentrate on solving the business problem at hand. Java EE Containers © EPractize Labs Software. All rights reserved
  • 10. MyExamCloud Introduction to Java EE EJB Component EJB is a component to write business logic in an enterprise application and it runs inside a container named EJB container. The typical Java EE application server architecture is shown below: Introducing EJB Component © EPractize Labs Software. All rights reserved
  • 11. MyExamCloud Introduction to Java EE EJB Component The run-time portion of a Java EE product. A Java EE application server provides EJB and Web containers. Java EE Application Server © EPractize Labs Software. All rights reserved
  • 12. MyExamCloud Introduction to Java EE EJB Component Manages the execution of EJBs for Java EE applications. Enterprise beans and their container run on the Java EE application server. Enterprise JavaBeans (EJB) container © EPractize Labs Software. All rights reserved
  • 13. MyExamCloud Introduction to Java EE EJB Component Manages the execution of JSP page and servlet components for Java EE applications. Web components and their container run on the Java EE application server. Web container © EPractize Labs Software. All rights reserved
  • 14. MyExamCloud Introduction to Java EE EJB Component Manages the execution of application client components. Application clients and their container run on the client. Application client container © EPractize Labs Software. All rights reserved
  • 15. MyExamCloud Introduction to Java EE EJB Component Java EE provides the following EJB components. 1. Stateful Session Bean 2. Stateless Session Bean 3. Singleton Session Bean 4. Message Driven Bean Note that Singleton bean is under session type introduced in Java EE 6. EJB Components © EPractize Labs Software. All rights reserved
  • 16. MyExamCloud Introduction to Java EE EJB Component Using Stateless Session Beans You are developing a business component where it does not contain the data for a specific client. Your search component will be a best example for this scenario. Note that search requires only one method invocation with search query among all the clients to perform the generic task (executing search query on server side). Example: Google search, Yahoo search and MSN search. The following contents are taken from Oracle: When to use Stateful Session Bean: If the bean does not contain the data for a specific client. If there is only one method invocation among all the clients to perform the generic task. EJB Design Decision © EPractize Labs Software. All rights reserved
  • 17. MyExamCloud Introduction to Java EE EJB Component Using Stateful Session Beans You are developing a business component where it wants to hold information about the client across method invocation. The most common example for this type of implementation would be “Shopping Cart”, where it needs to hold client specific information. Example: Gmail, Yahoo Mail and Facebook. The following contents are taken from Oracle: When to use Stateful Session Bean: What the bean wants to holds information about the client across method invocation. When the bean works as the mediator between the client and the other component of the application. When the bean have to manage the workflow of several other enterprise beans. EJB Design Decision © EPractize Labs Software. All rights reserved
  • 18. MyExamCloud Introduction to Java EE EJB Component Using Singleton Session Beans You can easily decide by the name itself, when you want to have exactly one instance of a session bean go for Singleton session bean. You are developing an application where you want to have some configuration parameters needs to be used across different modules and they needs to be available during your server startup. You can easily implement this scenario by using Singleton Session bean. The following contents are taken from Oracle: When to use Singleton Session Bean: State needs to be shared across the application. A single enterprise bean needs to be accessed by multiple threads concurrently. The application needs an enterprise bean to perform tasks upon application startup and shutdown. The bean implements a web service. EJB Design Decision © EPractize Labs Software. All rights reserved
  • 19. MyExamCloud Introduction to Java EE EJB Component Using Message Driven Beans Unless like regular Java method calls MDBs are called asynchronously without blocking. Note that Java EE 6. Note that Session beans allow you to send JMS messages and to receive them synchronously but not asynchronously. To avoid tying up server resources, do not to use blocking synchronous receives in a server-side component; in general, JMS messages should not be sent or received synchronously. To receive messages asynchronously, we should use a message-driven bean. EJB Design Decision © EPractize Labs Software. All rights reserved
  • 20. MyExamCloud Introduction to Java EE EJB Component One better way to study EJB is by taking Oracle’s Java EE 7 Developer Certification. Prepare for your Java EE 7 Application Developer Certification using MyExamCloud course: https://www.myexamcloud.com/onlineexam/1z0-900-mock-exams-ocp-java-ee-aplication-developer.course Java EE 7 Developer Certification © EPractize Labs Software. All rights reserved