EAD Lecture1.2 - Introduction To Java EE
EAD Lecture1.2 - Introduction To Java EE
Introduction to Java EE
Outline
Enterprise Applications
What is Java EE
EJBs
A brief technical look at EJBs
Java EE APIs
Page 2
Introduction to Java EE
Enterprise Applications
Applications designed to solve problems encountered by
large enterprises
Used by large corporations, governments, etc.
Useful for even small organizations in an increasingly
networked world
Large-scale Scalable
Reliable Secure
Page 3
Introduction to Java EE
Multi-Tiered Architecture
Functionality of application separated into isolated
functional areas called tiers
3-tiered architecture:
Page 4
Introduction to Java EE
Multi-Tiered Architecture
Page 5
Introduction to Java EE
Enterprise Applications
Business
Logic
Standalon
e
Network
Network Communication
Communication
Web
Mobile
Client
PLSQL
Client
Client Session
Session Management
Management
Load
Load Balancing
Balancing
Middle Tier
Failover
Failover
Page 6
Very Complex
Needs technical expertise
Time consuming
Very costly
Tables
Database
Database Connectivity
Connectivity
Authentication
Authentication // Security
Security
Pooling
Pooling // Caching
Caching
Transaction
Transaction Management
Management
Database
Introduction to Java EE
Enterprise Applications
this
y
l
n
o
o
We d
Network
Network Communication
Communication
Client
Client Session
Session Management
Management
Business
Logic
Authentication
Authentication // Security
Security
Pooling
Pooling // Caching
Caching
Transaction
Transaction Management
Management
Database
Database Connectivity
Connectivity
Load
Load Balancing
Balancing
Failover
Failover
Java EE
Page 7
Introduction to Java EE
Java Technology
2.
3.
Page 8
Introduction to Java EE
JVM
Page 9
Development
tools,
deployment
technologies,
other class
libraries
Introduction to Java EE
API
Cut-down version of Java SE APIs
Page 10
Introduction to Java EE
API
Java EE
API
Java SE
JVM
Page 11
Development Model
Runtime environments
(containers)
Development tools,
Deployment
Technologies,
other class libraries
Introduction to Java EE
Multi-Tiered Applications
JavaEE Application
Server
Web application
Web browser
Business
Logic
Database
Standalone
Application
Client tier
Page 12
Middle tier
Data tier
Introduction to Java EE
Multi-Tiered Applications...
JavaEE Application
Server
Web application
Web browser
Servlets / JSP
Web Container
Business EJBs
Logic
Database
Standalone
Application
Client tier
Page 13
EJB Container
Business Logic
Middle tier
Data tier
Introduction to Java EE
Session
Beans
Customer
Order
Manager
Inventory
Manager
Customer
Order
OrderNo: 1532
Customer
Order
OrderNo: 1533
Project
Activity
Manager
Inventory
Part
PartNo: BP03
EJB Container
Page 14
Entity Beans
Incoming
Customer
Order
Receiver
Message
Driven Beans
Introduction to Java EE
A managed object
1. Encapsulates business logic
We write them!
Page 15
that contains
business logic and
live business data
of an enterprise application.
source: www.developer.com
Introduction to Java EE
Types of EJBs
Session Beans
Customer
Order
Manager
Entity Beans
Customer
Order
Order No: 1003
Introduction to Java EE
Types of EJBs
Session Beans
Customer
Order
Manager
Entity Beans
Customer
Order
Order No: 1003
Page 17
Introduction to Java EE
A Simple Example
A user queries the total
amount of customer
order 1468
Customer Order
Manager
Standalone
Application
Get an instance of
CustomerOrderManager
session bean
Call its method:
calculateTotal (1468)
Customer
Order
Order No: 1468
Customer
Order Line
Order No: 1468
1.
2.
Customer
Order Line
3.
Line No: 2
4.
}
Display result
Line No: 1
Customer
Order Line
Order No: 1468
Line No: 3
Page 18
Middle tier
Database
Introduction to Java EE
A Simple Example
A user queries the total amount
of a customer order
Customer
Order
Order No: 1003
Customer
Order Line
Order No: 1003
Line No: 1
Standalone
Application
Customer
Order Line
Customer Order
Manager
Get an instance of
CustomerOrderMan
ager session bean
Call its
calculateTotalAmou
nt(R2918)
Customer
Order Line
Order No: 1003
Display result
Line No: 3
Database
Page 19
Introduction to Java EE
Client
Business
Partner / Other
System
IIOP
Web
Application
Mobile
Application
Web Browser
WSDL/SOAP/UDDI
Mobile Device
HTTP
HTTP
JNDI
JTA
Java RMI-IIOP
JAXP
Web Container
JAX-RPC
Servlets
JSPs
JAAS
EJBs
EJB Container
JDBC
JAX-RPC
JMS
JavaMail
Connectors
SQL
Back end
Database
Page 20
JCA
Proprietary Protocol
Existing System
Existing
System //
Legacy
Legacy System
System
Java EE
Application
Server
WSDL/
SOAP/
UDDI
Business
Partner / Other
System
SMTP/
POP3/
IMAP
Message
Oriented
Middleware
Introduction to Java EE
JNDI
Java Naming and Directory Interface
Utilized by J2EE applications to locate resources and
objects in portable fashion
Introduction to Java EE
What is a Servlet?
Java objects which extend the functionality of a HTTP
server
Dynamic contents generation
Better alternative to CGI, NSAPI, ISAPI, etc.
Efficient
Platform and server independent
Session management
Java-based
Introduction to Java EE
Request CGI1
Request CGI1
Request CGI2
Request CGI2
Request CGI1
Request CGI1
Request Servlet1
Request Servlet1
Request Servlet2
Request Servlet2
Request Servlet1
CGI
CGI
Based
Based
Webserver
Webserver
Servlet
Servlet Based
Based Webserver
Webserver
Servlet1
Servlet1
JVM
JVM
Servlet2
Servlet2
Introduction to Java EE
Introduction to Java EE
RMI-IIOP (read as "RMI over IIOP") denotes the Java remote method invocation
(RMI) interface over the Internet Inter-Orb Protocol (IIOP), which delivers Common
Object Request Broker Architecture (CORBA) distributed computing capabilities to
the Java 2 platform. Java RMI-IIOP was developed by Sun Microsystems and IBM,
combining the best features of Java RMI technology with the best features of CORBA
technology.
The Java Naming and Directory Interface (JNDI) is a Java API for a directory service
that allows Java software clients to discover and look up data and objects via a name.
Like all Java APIs that interface with host systems, JNDI is independent of the
underlying implementation. Additionally, it specifies a service provider interface (SPI)
that allows directory service implementations to be plugged into the framework. The
implementations may make use of a server, a flat file, or a database; the choice is up
to the vendor.
Servlets are Java programming language objects that dynamically process requests
and construct responses. The Java Servlet API allows a software developer to add
dynamic content to a Web server using the Java platform.
Page 25
Introduction to Java EE
Java API for XML-based RPC (JAX-RPC) allows a Java application to invoke a Javabased Web Service with a known description while still being consistent with its WSDL
description. It can be seen as Java RMIs over Web services. JAX-RPC 2.0 was renamed
to JAX-WS 2.0 (Java API for XML Web Services).
JDBC (Java Database Connectivity) is an API for the Java programming language that
defines how a client may access a database. It provides methods for querying and
updating data in a database. JDBC is oriented towards relational databases.
The Java Transaction API (JTA) is one of the Java EE APIs allowing distributed
transactions to be done across multiple XA resources.
The Java API for XML Processing or JAXP (pronounced jaks-p), is one of the Java XML
programming APIs. It provides the capability of validating and parsing XML documents.
Page 26
Introduction to Java EE
The Java Message Service (JMS) API is a Java Message Oriented Middleware
(MOM) API for sending messages between two or more clients.
JavaMail is a Java API used to receive and send email via SMTP,POP3 and IMAP.
Page 27