Introducing to J2EE(Java Server
Programming)
©[Link]
Objectives
• To understand the J2EE infrastructure
• To know what are the needs for enterprise programming
• To understand about the evolution of enterprise application
framework and types of software architectures
• To understand about J2EE components, J2EE containers, J2EE
APIs and services technologies
Learning Outcome
• After studying this lesson, the student will be able to understand the
J2EE infrastructure and J2EE components, J2EE containers, J2EE APIs
and services technologies and how they work.
Chapter Focus
• What is J2EE?
• Need for Enterprise Programming
• Evolution of Enterprise Application Frameworks
• Three layers of an application
• Three types of Software Architecture
• Architecture of J2EE
• J2EE components
• J2EE containers
• J2EE APIs and Technologies
What is J2EE?
• J2EE / Java EE is a platform popularly used for
building server-side applications, and
provides a convenient component-based approach.
• It is a distributed computing architecture.
• Java EE is targeted at large-scale business systems
Need for Enterprise Programming
• Enterprise means a business organization.
• Enterprise applications are those software applications that
facilitate various activities in an enterprise.
• Enterprise software is an integral part of an Information
System, and as such includes web site software production.
• E.g.,
Online shopping system (Amazon, eBay, [Link])
Online payment processing system (PayPal)
About Enterprise Applications
• Things that make up an enterprise application :
Presentation logic
Business logic /Application logic
Data access logic (and data model)
System services
• The evolution of enterprise application framework reflects
How flexibly you want to make changes
Where the system services are coming from
Evolution of Enterprise Application
Frameworks
• One Tier
• Two Tier
• Three Tier
RPC based
Remote object based
• Three tier (browser and Web server)
• A “tier” can also be referred to as a “layer”.
Three layers of an Application
• Three layers are involved in the application namely:
1. Presentation Layer,
2. Business Layer, and
3. Data Layer.
Presentation Layer
• Presentation layer is:
also known as the Client layer.
the top most layer of an application
the layer we see when we use the software.
• The main function of this layer is
to pass the information which is given by the user in terms of
keyboard actions, mouse clicks to the Application Layer.
to communicate with the Application layer
For example, the login page of Gmail where an end-user
could see text boxes and buttons to enter user id, password, and
to click on sign-in.
Application Layer
• Application Layer
is also known as Business Logic Layer which is also known as
the logical layer
controls an application’s functionality by performing detailed
processing
acts as a mediator between the Presentation and the Database
layer
• Complete business logic will be written in this layer.
As in the Gmail login page example, once the user clicks on the
login button, the Application layer interacts with the Database
layer and sends required information to the Presentation layer.
Data Layer
• The data is stored in this layer.
• The application layer communicates with the Database layer
to retrieve the data.
• It contains methods that connect the database and performs
required action
e.g.: insert, update, delete, etc.
Software Architectures: One Tier Architecture
• One-tier architecture has all the layers such as Presentation,
Business, Data Access layers in a single software package.
• Applications that handle all the three tiers such as MP3 player,
MS Office come under the one-tier application.
• The data is stored in the local system or a shared drive
One Tier Architecture
Software Architectures: Two-Tier Architecture
• The Two-tier architecture is divided into two parts:
1. Client Application (Client Tier)
2. Database (Data Tier)
• The client system handles both Presentation and Application layers
• The Server system handles the Database layer.
Eg. desktop-based client-server applications with a central
database, providing shared access to data
• It is also known as a client-server application.
• The client system sends the request to the server system and the
Server system processes the request and sends back the data to the
Client System.
Two-Tier Architecture
Software Architectures: Three-Tier Architecture
• The Three-tier architecture is divided into three parts:
1. Presentation layer (Client Tier)
2. Application layer (Business Tier)
3. Database layer (Data Tier)
• the client system handles the Presentation layer
• the Application server handles the Application layer
• the Server system handles the Database layer.
• Eg: Web-Based E-Commerce Application
Three-Tier Architecture
Architecture of J2EE
• J2EE can be expanded as Java 2 Enterprise Edition
• offers a development environment for enterprise application
creation and implementation.
• is made up of three tiers:
Client Tier: Client tier consists of user programs that interact
with the user for request and response.
Middle Tier: Middle tier usually contains enterprise beans
and web services that distribute business logic for the
applications.
Enterprise Data Tier: Enterprise data is stored in a relational
database. This tier contains containers, components and
services.
Architecture of J2EE
J2EE Components
• J2EE specifies both the service APIs for building the application and the
infrastructure for managing the application.
• J2EE Runtime
A runtime infrastructure for managing and hosting applications. All
runtime applications are located in this server.
• J2EE APIs and Technologies
A set of Java APIs describes the programming model for J2EE
application
Basic Requirements
J2SE SDK & JVM
to run J2EESDK and provides core APIs for writing J2EEcomponents,
core development tools.
J2EE(SDK) APIs
J2EE Containers
• EJB Container
• Web Container
• Application Client Container
• Applet Container
Types of J2EE Technologies
• Component Technologies
• Services Technologies
• Communication Technologies
J2EE Component Technologies
1. Web Component
• Concerning respond to HTTP requests
• Web components are in the form of either Servlet or JSP
• Web components run in a Web container
Tomcat and Resin are popular web containers
All J2EE compliant app servers (Apache Tomcat, Glassfish,
JBoss) provide web containers
• Web container provides system services to Web components
Request dispatching, security, and life cycle management
Servlet
• Servlet is a technology which is used to create a web application.
• Servlet is an API that provides many interfaces and classes
including documentation.
• Servlet is an interface that must be implemented for creating any
Servlet.
• Servlet is a class that extends the capabilities of the servers and
responds to the incoming requests. It can respond to any requests.
• Servlet is a web component that is deployed on the server to
create a dynamic web page.
Java Server Pages (JSP)
• JSP technology
is used to create web application just like Servlet technology.
is an extension to Servlet because it provides more
functionality than servlet such as expression language, JSTL,
etc.
• The JSP pages
consists of HTML tags and JSP tags.
are easier to maintain than Servlet because we can separate
designing and development.
J2EE Component Technologies
2. Enterprise Java Bean (EJB) Component
• Enterprise JavaBeans (EJB) is the server-side and platform-
independent Java application programming interface (API) for
Java Platform, Enterprise Edition (Java EE).
• EJB is used to simplify the development of large distributed
applications.
• The EJB container handles transaction management and security
authorization.
J2EE Component Technologies
3. XML
• J2EE provides a number of APIs for developers working with
XML:
Java API for XML Processing (JAXP)
Java API for XML Binding (JAXB)
Java API for XML Registers (JAXR)
Java API for XML Messaging (JAXM)
Java API for XML-based Remote Procedure Calls (JAX-RPC)
Service Technologies
• Java Transaction API and Service
• JDBC
• JNDI
• Java Mail
• JMS
• JAAS
Communication Technologies
• Internet Protocol
HTTP
TCP/IP
OMG Protocols
SSL
• Remote Object Protocol
RMI and RMI-IIOP
Messaging
Data Formats
Java IDL
Summary
Java EE
• is a platform popularly used for building server-side applications
• specifies both the service APIs for building the application and
the infrastructure for managing the application.
• can be expanded as Java 2 Enterprise Edition.
• is made up of three tiers: Client Tier, Middle Tier, and Enterprise
Data Tier.