Java 2 Enterprise Edition

cavalcadejewelSoftware and s/w Development

Nov 18, 2013 (3 years and 8 months ago)

154 views

Java 2 Enterprise Edition

An Introduction



SCOT

2

Introduction to J2EE

(c)CDAC(Formerly NCST)

Agenda


What is J2EE?


Evolution of Distributed Transactional Computing


Why J2EE?


J2EE


Deliverables (what and why?)


Basic Architecture


Components and Containers


Roles


Lifecycle


SCOT

3

Introduction to J2EE

(c)CDAC(Formerly NCST)

Overview


A collection of enterprise technologies


Provides a component based approach to the design,
development, assembly and deployment of enterprise
applications


An open industry standard
(initiative led by Sun Microsystems)

J2EE enables solutions for developing, deploying and
managing n
-
tier sever
-
centric enterprise applications


SCOT

4

Introduction to J2EE

(c)CDAC(Formerly NCST)

Mission


To provide a platform
-
independent, portable, multiuser,
secure, and standard enterprise
-
class platform for
server side deployments written in the Java Language



Implement a standardized execution environment for
distributed enterprise applications


SCOT

5

Introduction to J2EE

(c)CDAC(Formerly NCST)

Evolution of Distributed
Transactional Computing


Overview of technologies leading to distributed
computing


1 tier, 2 tier, 3 tier, n tier architecture


Distributed objects


Application Servers


SCOT

6

Introduction to J2EE

(c)CDAC(Formerly NCST)

Single tier application


Data access, presentation and business logic, all tightly coupled
in one monolithic application

Dumb terminal

Main frames


SCOT

7

Introduction to J2EE

(c)CDAC(Formerly NCST)

Client/Server architecture

[2
-
tier]


Presentation, business and data model processing logic into client
application


Server is typically a database server


Client sends SQL statements, retrevies raw data

Workstation

Database Specific APIs

Database

Server


SCOT

8

Introduction to J2EE

(c)CDAC(Formerly NCST)

Client/Server architecture

[2
-
tier]


Fat Clients


Data model tighly coupled with each client ( a change in
schema will require making changes in every client )


Clients use database APIs for communication/transactions etc.


All processing at the client end


Issues


Scalability, Performance, Security, Reuse,
Maintenance


SCOT

9

Introduction to J2EE

(c)CDAC(Formerly NCST)

Three
-
tier architecture


Thin clients, business logic moves to middle tier


Separates UI, business logic and data model


Middle tier serves the business logic as “
Services



Explict management of multi
-
threading, concurrency, transactions,
security etc. required

Database

Server

RPC

Database Specific

APIs calls

RPC


SCOT

10

Introduction to J2EE

(c)CDAC(Formerly NCST)

Distributed Object architecture

[3
-
tier]


Business logic and data model as distributed objects
(solutions
available from Java RMI
-
IIOP, CORBA, Microsoft .NET)


Uses object request protocols


IIOP, RMI, DCOM/COM+


Middle tier handles


concurrency, multi
-
threading, connection
pooling etc.


Still, can be difficult to program

Database

Server

IIOP, RMI, DCOM

Database Specific

APIs calls

Distributed Objects


SCOT

11

Introduction to J2EE

(c)CDAC(Formerly NCST)

Adding Web tier

[N
-
tier]


Distributed computing became ubiquitous with Web
-
interfaces/clients


CGI/Perl


difficult to maintain, scalability issue


A mixture of different technologies, difficult to maintain/manage


Proprietary solutions limit exploration

Database

Server

JSP/Servlets,
ASP, CGI

Application Server

IIOP, RMI,
COM, DCOM

Web Server


SCOT

12

Introduction to J2EE

(c)CDAC(Formerly NCST)

Moving from 1
-
tier to n
-
tier


Distinct separation of responsibilities


Change in a specific tier possible without disturbing
other tiers
-

easier maintenance, deployment


Reusable, flexible, scaleable


However,


Requires developer to worry details of distributed protocol,
security, load balancing, concurrency, transactions, resource
management …


SCOT

13

Introduction to J2EE

(c)CDAC(Formerly NCST)

N
-
tier J2EE Architecture

RMI
-
IIOP

HTTP
(JSP/Servlets)

Web
-
Client

Application
Client

EJB Application Server

Web Server

Database Server
(RBDMS)

Legacy Systems

Container





SCOT

14

Introduction to J2EE

(c)CDAC(Formerly NCST)

The Java 2 Platform

Micro Edition

(J2ME)

Enterprise Edition

(J2EE)

Standard Edition

(J2SE)

Hand
-
held
devices

Desktop

High
-
end
Servers

Workgroup
Servers


SCOT

15

Introduction to J2EE

(c)CDAC(Formerly NCST)

J2EE Bundle


APIs and technology specification


A collection / integration of various enterprise APIs


Development and Deployment platform


A unified platform for server
-
side development


Reference Implementation


Implements the J2EE specification & demonstrates its viability


Compatibility tests


Certifies a J2EE product, confirms application portability


J2EE Blueprints


Programming model, patterns, guidelines, best practices


SCOT

16

Introduction to J2EE

(c)CDAC(Formerly NCST)

J2EE Technologies


Component Technology


Applet, application clients, Enterprise beans, web components
(JSP / Servlets)


Service Technology


JDBC, JNDI, JTS, Connector Architecture, Web Services etc


Communication Technology


RMI
-
IIOP


Internet protocols (HTTP, SSL, TCP/IP)


Messaging (JMS, JavaMail)


SCOT

17

Introduction to J2EE

(c)CDAC(Formerly NCST)

J2EE APIs
(Bundled)


Java 2 SDK


Java Standard APIs (part of J2SE)


Enterprise JavaBeans (EJB)


Aritecture for building server
-
side components


Java Remote Method Invocation (RMI) & RMI
-
IIOP


Method invocation across Java virtual machines. Can also integrate
with other clients comfirming CORBA IIOP specification


Java Naming and Directory Interface (JNDI)


Naming service for locating resources over the network


Java Database Connectivity (JDBC)


Java interface to relational database


Java Servlets & Java Server Pages (JSP)


Technology allowing dymanic web content generation


Java Activation Framework (JAF)


J2EE Connector Architecture


SCOT

18

Introduction to J2EE

(c)CDAC(Formerly NCST)

J2EE APIs
(Bundled) contd …


Java Messaging Service (JMS)


Enables asyncronous communication, including point
-
to
-
point and
publish/subscribe messing


Java IDL


Java technology based CORBA ORB implementing a subset of
CORBA specification


JavaMail


Mailing APIs


Java API for XML Parsing (JAXP)


XML parsing and manipulation. Used to describe EJB components,
file scripts


Java Transaction API (JTA) and Java Transaction Service (JTS)


Used to manage transactions


Java Authentication and Authorization Service (JAAS)


Security services API


Others (performance specific, not mandated by the specification)


Load balancing, data caching, transparent failover, etc


SCOT

19

Introduction to J2EE

(c)CDAC(Formerly NCST)

Basic Architecture


SCOT

20

Introduction to J2EE

(c)CDAC(Formerly NCST)

Application Deployment
Architecture


SCOT

21

Introduction to J2EE

(c)CDAC(Formerly NCST)

Application Model


Three fundamental parts


Components


Captures the business process & data model


Containers


Intercede between clients and components and provides services
like resource pooling, transaction support, etc


Defines component behaviours for clients


Hides low
-
level system functionalities


Connectors


Provides plug
-
in support for application portability


SCOT

22

Introduction to J2EE

(c)CDAC(Formerly NCST)

J2EE Components


The J2EE platform uses a multitiered distributed
application model


The J2EE application components parts comprise:


Client
-
tier components
(run on the client machine)
.


Web
-
tier components
(run on the J2EE server)
.


Business
-
tier components
(run on the J2EE server)
.


Enterprise information system (EIS)
-
tier software
(runs on the
EIS server)
.




Essentially considered to be
three
-
tiered application
, because of being
distributed over client, J2EE server and the database.


SCOT

23

Introduction to J2EE

(c)CDAC(Formerly NCST)

J2EE Components: Client Tier


Client


Web clients
(web
-
browser, web pages, applets

)


Application client
(application user interface built using Swing
or AWT, or a command line interface)


CORBA IIOP complaint clients


SCOT

24

Introduction to J2EE

(c)CDAC(Formerly NCST)

J2EE Components: Web
-
tier


Web components


Servlets or JSP pages


JavaBeans (optional)


SCOT

25

Introduction to J2EE

(c)CDAC(Formerly NCST)

J2EE Components: Business tier


Business Components


Enterprise Beans handle the application logic


Separates business process (session beans) and data
component (entity beans)


Applications requiring messaging facility use JMS


SCOT

26

Introduction to J2EE

(c)CDAC(Formerly NCST)

J2EE Components: Data tier


Application Database Server


Any relational database (eg Oracle, MS SQL, etc)


Enterprise Information System (EIS)


Includes enterprise systems like ERP, mainframe transaction
processing, database systems and other legacy information
systems


J2EE applications often rely on this tier to store the
enterprise’s business critical data


SCOT

27

Introduction to J2EE

(c)CDAC(Formerly NCST)

Container Services


Security


Transaction Management


Naming and directory


Remote connectivity


Lifecycle management


Persistance


Concurrency


SCOT

28

Introduction to J2EE

(c)CDAC(Formerly NCST)

Container Types


The deployment process installs J2EE application
components in the J2EE containers


EJB container


Web container


Application client container / Applet container


The J2EE server provides EJB and Web containers
and is the operating run
-
time environment


SCOT

29

Introduction to J2EE

(c)CDAC(Formerly NCST)

Client

J2EE Server and Containers

Database





Application

Client

Container





EJB Container





Web Container

Application

Client

Web Browser

Enterprise

Bean

Enterprise

Bean

Servlet

JSP Page

J2EE Server


SCOT

30

Introduction to J2EE

(c)CDAC(Formerly NCST)

J2EE Roles


J2EE product provider


One who designs and makes available the J2EE platform,
APIs and other features defined in the J2EE specification


Component Provider


One who provides web components, enterprise beans, applets
or application clients for use in J2EE applications.


Application Assembler


One who gets the components and assembles it into an
application


SCOT

31

Introduction to J2EE

(c)CDAC(Formerly NCST)

J2EE Roles


Application Deployer and Administrator


One who configures and deploys the J2EE application,
administers and monitors the deployment


Tool provider


One who creates development, assembly and packaging tools
used by component providers, assemblers and deployers


SCOT

32

Introduction to J2EE

(c)CDAC(Formerly NCST)

J2EE Lifecycle


SCOT

33

Introduction to J2EE

(c)CDAC(Formerly NCST)

References


J2EE Tutorial,
Sun Microsystems


Simplified guide to the Java 2 Platform, Enterprise
Edition,
Sun Microsystems


Sun TechDays Conference 2000
-
2001 slides,


Sun Microsystems


Mastering Enterprise JavaBeans, 1
st

& 2
nd

Edition


By Ed Roman