Unit 7 Enterprise Application Architectures
Unit 7 Enterprise Application Architectures
com
Unit-7/ Java Programming-II
Overview of J2EE
Java is used to build two types of applications; standalone and internet based applications. All
the Java programs we learned and developed until now are standalone applications. These
applications are either console based applications that spit the output to the console, or GUI
based applications like word processors, paint tools etc. where funky windows show up to
display information. The other side of Java is that it can be used build Internet based applications
that can be used by millions of users at the same time. This is the true power of Java. Such
internet applications are popularly known as enterprise level applications, as they form the faces
of today’s modern enterprises on the internet.
J2EE stands for Java 2 Enterprise Edition.
J2EE is a platform for building server side components and applications. It provides the
infrastructures needed for these applications.
J2EE is a platform and not a language.
We use J2EE platform to build large scale enterprise level applications in Java that run on
Internet.
A J2EE platform is also known as J2EE Application Server.
A J2EE application server supports all the standard J2EE specifications like JDBC (Java
Database Connectivity), Servlet, JSP (Java Server Pages), EJB (Enterprise JavaBeans),
JMS (Java Message Service) etc.
https://genuinenotes.com
https://genuinenotes.com
Unit-7/ Java Programming-II
https://genuinenotes.com
https://genuinenotes.com
Unit-7/ Java Programming-II
https://genuinenotes.com
https://genuinenotes.com
Unit-7/ Java Programming-II
Two-Tier Architecture:
Two Tier architecture is also known as Client-Server architecture
It consists mainly of two tiers: data and client (GUI).
The application logic can be located in either the client tier or data tier. If application
logic is located in client tire it results in a fat client. If application logic is located in data
tire, it results in a fat server (see Figure).
This type of architecture suffers from a lack of scalability, because both the client and the server
have limited resources. In addition to the negative effect of network traffic to transfer data to the
fat client, another issue is maintainability. We have to roll out the new system version to all
system users.
Three-Tier Architecture:
To address the issues of the two-tier architecture, the application logic will be placed in
its own tier.
Thus applications can be portioned into three tiers
1. Presentation layer (Client Tier)
2. Application layer (Business Tier)
3. Database layer (Data Tier)
Client system handles Presentation layer, Application server handles Application layer
and Server system handles Database layer.
https://genuinenotes.com
https://genuinenotes.com
Unit-7/ Java Programming-II
The first tier is referred to as the presentation layer, and consists of the application GUI
(presentation layer).
The middle tier, or the business layer, consists of the business logic to retrieve data for
the user requests.
The back-end tier, or data layer, consists of the data needed by the application.
Figure below illustrates the three-tier architecture.
The decoupling of application logic from either presentation or data increases the
flexibility of the application design.
Multiple views or a GUI can be added without changing the existing application logic.
Similarly, multiple applications can be created using the same data model.
Changing the components of one tier should not impact the other two tiers. For example,
any change to the data or GUI will not affect the application logic.
Advantages
Centralized business logic will offer more flexibility. Business logic is only required to
be changed at one place there by eliminating the installation process of the application on
client systems.
Less network traffic, thereby improving the performance of the application.
Application performance is no longer dependent on client computer due to the business
logic isolation.
No more maintenance nightmares.
https://genuinenotes.com
https://genuinenotes.com
Unit-7/ Java Programming-II
Disadvantages
Any update to the business logic must be accepted by all the clients even if they are not
ready for updates.
N-Tier Architecture
In this type of architecture, the application logic is divided based on the functionality rather than
physically like in 2-tier and 3-tier architectures.
A typical n-tier architecture contains the following elements:
User Interface: This is something like a web browser that handles the client interactions.
Presentation Logic: This defines format using which the information will be displayed.
Business Logic: Encapsulates all the business rules by interacting with data sources.
Infrastructure Services: These are utility services that the presentation and business logic makes
use of.
Data tier: This contains all the enterprise data
Breaking the application logic based on functionality offers several benefits like flexibility,
better maintenance, improved performance, reusability of code and may more. This architecture
is also referred to as Model-View-Controller (MVC) architecture.
Note: According to syllabus, we should just focus on 2 tier and 3 tier architecture
https://genuinenotes.com
https://genuinenotes.com
Unit-7/ Java Programming-II
J2EE Architecture
The client/server application architecture, which was a two-tier architecture, evolved over time to
a multitier architecture. This natural progression occurred as additional tiers were introduced
between the end-user clients and back-end systems. Although a multitier architecture brings
greater flexibility of design. It also increases the complexity of building, testing, deploying,
administering, and maintaining application components.
The J2EE server provides the EJB and Web container. The EJB container
https://genuinenotes.com
https://genuinenotes.com
Unit-7/ Java Programming-II
https://genuinenotes.com