Professional Documents
Culture Documents
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.
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.
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.
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.
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
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.
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
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.
Client Client
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