You are on page 1of 29

Introduction

J2EE is not the Java , that comprises of topics like Applets, Consolemode programs, Standalone GUI, Multithreading, Graphics, Exception-handling, String processing, IO Streams, Java Beans in BDK, Swing etc., with not any real life applications for example, DataBase access! . But that doesn t means that Core Java is useless. As the name suggests, it is the core and absolutely essential . But, Java has always been a language for the Web and Enterprise. The only topics that could bridge the Core and Enterprise Java are Sockets & Beans.

The

TM Java

Platform

Most of you know there are three flavors of Java - Micro Edition, Standard Edition, and Enterprise Edition. These three flavors of Java represent three distinct target market segments each of which has unique issues and requirements that need to be addressed somewhat differently.

What is J2EE?
y Sun's J2EE architecture is multi tiered architecture

and it eliminates all the problems of two-tier architecture. It also eliminates the need of writing thin-client multithread applications, which were earlier used to write distributed transactional applications for the enterprise. y Thin-client multi tiered applications are very fast, secure and reliable. But writing the thin-client multi tiered applications are not easy and it involves many lines of complicated code to handle transaction and state management, multithreading, resource pooling and other complex low-level details.

What is J2EE?
y In the JavaTM 2 Platform, Enterprise Edition (J2EETM), low-level details are separated from the business logic. Now the developers will more concentrate on the business logic rather than the low-level details. Low-level details are managed by the application container of the application server.

Need for Enterprise programming


A well designed enterprise application should meet the following goals y Robustness y Performance y Object Oriented design Principles y Avoid Complexity y Maintainable and Extensible y Easy to Test y Promote reuse y Support for the multiple client types y Portability

Advantages of J2EE
Specifically there are two major paths to develop enterprise applications first is .NET platform suite by Microsoft and second J2EE by Sun. There are lot of other companies also like BEA, IBM, Oracle, etc. Having all these choices Java has a great acceptance because of following advantages y Platform Independence y Managed Objects y Reusability y Modularity

Platform Independence
y Enterprise applications comprises of wide variety

of information which has to spread across many different type of platforms. y Hence, it is essential to have a programming language that is capable of running across the different platforms and that is Java.

Managed Objects
y The platform

independent J2EE provides a managed environment for component. y J2EE applications are container-centric. y Another important property of the J2EE applications is the ease by which it can modify and control the behavior of applications without changing the codes.

Reusability
In the programming field, the code reuse is the most important and desired feature. This can be done by following ways y To segregate an application s requirements into individual components. y To use object oriented technology to encapsulate shared functionality. Java uses both the ways.

Modularity
y When

we develop a complete server-side application, the program get large and complex very quickly. It is always best to break down the application into various modules that are individually responsible for a specific task. This also makes the application much easier to maintain and understand.

Enterprise Architecture Types


A software application composition can be broken down into three logical layers y User Interface Presentation Layer y Processing Business Rule Layer y Reading and Writing Data Data Access Layer

Single Tier Architecture


User Interface Processing Reading/Writing Data

Some applications are developed to run on a single computer. In these type of applications all functionalities are embedded with in the same layer, such as user interface, processing, data manipulation, etc. Such type of architecture is called single tier systems.

Two Tier Architecture


Before the invention of PC s, applications were developed to run on mainframe based clientserver environment which used a thin client and thick server. Because application was predominantly run on server side.

Business Rule Data Access On Server

User Interface On Clients

Layers of Two Tier Architecture


User Interface Layer

Business Rule, Data Access Layer

The approach of these applications are centralized in which multiple users are allowed to work simultaneously. Clients provide only user interface and rest of all the processes are run on server side. All the services and data access provided by server is shared by all the users working on the application.

Three Tier Architecture

Clients

Application Server

Database Server

In this type application logic is divided into three layers 1. Presentation Layer User Interface Tier 2. Business Logic Layer Business Rule Tier 3. Data Layer Data-Store Tier

Layers of Three Tier Architecture


ser-Interface Tier This tier handles the user ser Interface a er interface logic. This is normall on the client side. Business Rule a er  Business Rule Tier This tier handles all of the business rules logic and Data Access a er validates user input from user interface tier. Data-Store Tier This tier is concerned with the storage and retrieval of data from databases.


Advantages of Three Tier Architecture


 Moving business rule components to an application

server can boost performance.  Multiple application servers can take advantage of load balancing and improve system fault tolerance.  Changes to business rule can migrate to a small number of application servers instead of a large number of workstations.  This also provides better code encapsulation allowing different people or even companies to implement each tier.

Multi Tier Architecture


UI Oriented Business Rule

Clients

Business Rule

Application Server

Database Server

 Presentation Layer User Interface Tier  Presentation Logic Layer User Interface

Oriented Business Logic Tier  Business Logic Layer Business Rule Tier  Data Layer Data-Store Tier

Layers of Multi Tier Architecture


includes the actual presentation of 1 - User Interface Layer screens and collect information. 2.This layer handles business rule logic that supports the UI. For example, validation of user input. 2-UI-Business Rule Layer 3.This is responsible for data manipulation and integration. It can combine data from SQL 3 - Business Rule Layer databases with flat files or even Internet resources. 4.This layer handles the storage and 4 Data Access Layer retrieval of data from databases, files, and other data sources.
1.This handles the UI logic, which

Advantages of Multi Tier Architecture


 The central idea in multi-tier architecture is to keep the

services physically close to data they work with.  Multi-tier architecture lets us put UI Oriented business rule components which are an excellent candidates for Java Beans which let us to create reasonable, platform independent components.  Data oriented business rule components are an excellent candidates for Enterprise Java Beans (EJB) which provides the facility of distributed programming.  Multi tier is a component based architecture. Therefore business logic services that support the UI can remain physically close to the client. Remaining application services can scale as additional resources become available.  The multi tier architecture is flexible about the placement and the presence of application servers.

J2EE Architecture
The J2EE Architecture allows the programmers to divide their work into two major categories y Presentation Logic Presentation Logic consists of all the program (JSP and Servlets), images and html files that are used to interact with the client. These files are archived into .war file. These files are installed on the web server and these interact with the users. y Business Logic These are EJB applications which implement the business logic of the system and are archived into .jar file. Business logic runs on the application server. These two types of archives are bundled into complete J2EE applications, and delivered as Enterprise Archive (EAR) file.

A typical J2EE Environment


EJB Container
Enterprise bean Enterprise bean Enterprise bean
Client

Client Client

Enterprise Information System (RDBMS, ERP, Legacy


Applications)

Web Container (Servlets, JSP Pages, HTML, XML) JNDI, JMS, JavaMail

Client

Client - Tier

Middle-Tier

EIS-Tier

J2EE Components
The J2EE platform is a distributed application server environment, i.e. Java environment comprises of following components y A runtime infrastructure for managing and hosting applications. All runtime applications are located in this server. y A set of Java APIs to build applications. These Java APIs describe the programming model for J2EE applications. For example, Java Servlet Technology, EJB Technology, JSP technology, etc.

J2EE Containers
are the interface between a component and the low-level platform-specific functionality that supports the component. y Before a Web, enterprise bean, or application client component can be executed, it must be assembled into a J2EE application and deployed into its container.
y Containers

Container Types

The deployment process installs J2EE application components in the J2EE containers illustrated in Figure

Container Types
y J2EE server - The runtime portion of a J2EE product.

A J2EE server provides EJB and Web containers. y Enterprise JavaBeans (EJB) container - Manages the execution of enterprise beans for J2EE applications. Enterprise beans and their container run on the J2EE server. y Web container - Manages the execution of JSP page and Servlet components for J2EE applications. Web components and their container run on the J2EE server.

Container Types
y Application

client container - Manages the execution of application client components. Application clients and their container run on the client. y Applet container - Manages the execution of applets. Consists of a Web browser and Java Plug-in running on the client together.

J2EE Technologies
J2EE Architecture consists of following technologies: y Java Database Connectivity (JDBC) y Java Naming and Directory Interface (JNDI) y Enterprise Java Beans (EJB) y Java Server Pages (JSP) y Java Servlets y Remote Method Invocation (RMI) y Java IDL/CORBA

You might also like