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
Ad

More Related Content

Similar to Introduction to Java EE EJB Component (20)

Enterprise application developement
Enterprise application developementEnterprise application developement
Enterprise application developement
Archana Jha
 
JEE Course - EJB
JEE Course - EJBJEE Course - EJB
JEE Course - EJB
odedns
 
Aravind vinnakota ejb_architecture
Aravind vinnakota ejb_architectureAravind vinnakota ejb_architecture
Aravind vinnakota ejb_architecture
tayab4687
 
EJB Container Using in Java Bean process
EJB Container Using in Java Bean processEJB Container Using in Java Bean process
EJB Container Using in Java Bean process
abhishek4493gn
 
Java ee introduction
Java ee introductionJava ee introduction
Java ee introduction
Moumie Soulemane
 
Java EE 7 introduction
Java EE 7  introductionJava EE 7  introduction
Java EE 7 introduction
Moumie Soulemane
 
Ejbandjsp 200119145750
Ejbandjsp 200119145750Ejbandjsp 200119145750
Ejbandjsp 200119145750
rajshreemuthiah
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts framework
s4al_com
 
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.pptLecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
KalsoomTahir2
 
Frameworks in java
Frameworks in javaFrameworks in java
Frameworks in java
Darshan Patel
 
Free EJB Tutorial | VirtualNuggets
Free EJB Tutorial | VirtualNuggetsFree EJB Tutorial | VirtualNuggets
Free EJB Tutorial | VirtualNuggets
Virtual Nuggets
 
ADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.ppt
rani marri
 
Advance java1.1
Advance java1.1Advance java1.1
Advance java1.1
Prince Soni
 
Servlets and jsp pages best practices
Servlets and jsp pages best practicesServlets and jsp pages best practices
Servlets and jsp pages best practices
ejjavies
 
Ejb and jsp
Ejb and jspEjb and jsp
Ejb and jsp
rajshreemuthiah
 
Sun Java EE 6 Overview
Sun Java EE 6 OverviewSun Java EE 6 Overview
Sun Java EE 6 Overview
sbobde
 
Bea weblogic job_interview_preparation_guide
Bea weblogic job_interview_preparation_guideBea weblogic job_interview_preparation_guide
Bea weblogic job_interview_preparation_guide
Pankaj Singh
 
Virtual Classroom
Virtual ClassroomVirtual Classroom
Virtual Classroom
chintanshah007
 
Lec2 ecom fall16
Lec2 ecom fall16Lec2 ecom fall16
Lec2 ecom fall16
Zainab Khallouf
 
Java EE EJB Applications
Java EE EJB ApplicationsJava EE EJB Applications
Java EE EJB Applications
DevelopIntelligence
 
Enterprise application developement
Enterprise application developementEnterprise application developement
Enterprise application developement
Archana Jha
 
JEE Course - EJB
JEE Course - EJBJEE Course - EJB
JEE Course - EJB
odedns
 
Aravind vinnakota ejb_architecture
Aravind vinnakota ejb_architectureAravind vinnakota ejb_architecture
Aravind vinnakota ejb_architecture
tayab4687
 
EJB Container Using in Java Bean process
EJB Container Using in Java Bean processEJB Container Using in Java Bean process
EJB Container Using in Java Bean process
abhishek4493gn
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts framework
s4al_com
 
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.pptLecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
KalsoomTahir2
 
Free EJB Tutorial | VirtualNuggets
Free EJB Tutorial | VirtualNuggetsFree EJB Tutorial | VirtualNuggets
Free EJB Tutorial | VirtualNuggets
Virtual Nuggets
 
ADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.ppt
rani marri
 
Servlets and jsp pages best practices
Servlets and jsp pages best practicesServlets and jsp pages best practices
Servlets and jsp pages best practices
ejjavies
 
Sun Java EE 6 Overview
Sun Java EE 6 OverviewSun Java EE 6 Overview
Sun Java EE 6 Overview
sbobde
 
Bea weblogic job_interview_preparation_guide
Bea weblogic job_interview_preparation_guideBea weblogic job_interview_preparation_guide
Bea weblogic job_interview_preparation_guide
Pankaj Singh
 

Recently uploaded (20)

Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
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