0% found this document useful (0 votes)
38 views8 pages

Unit 7 Enterprise Application Architectures

advance java

Uploaded by

pravesh koirala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views8 pages

Unit 7 Enterprise Application Architectures

advance java

Uploaded by

pravesh koirala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

https://genuinenotes.

com
Unit-7/ Java Programming-II

Unit-7: Enterprise Application Architectures


What are Java SE, Java EE and Java ME?
 Java SE: It stands Java Standard Edition which means all concepts related to core java
such as I/O, Collections, Threading, Concurrency, etc.
 Java EE: It stands Java Enterprise Edition which means all concepts related to advance
java such as servlets, web-services, jsps and all things related to web based software
applications. This is mainly used by enterprises for business solutions based on web or
network.
 Java ME: It means Java Micro Edition which means all concepts related to handheld or
appliances based applications. This has been used for mobile applications, home
appliances applications, etc.
Java Platform, Enterprise Edition (Java EE), formerly Java 2 Platform, Enterprise
Edition (J2EE), currently Jakarta EE

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.

1 Collected by Bipin Timalsina

https://genuinenotes.com
https://genuinenotes.com
Unit-7/ Java Programming-II

Software Architecture: One-Tier, Two-Tier, Three Tier, N Tier


 Software Architecture can be of One Tier, Two Tier, Three Tier and N-Tier
 A “tier” can also be referred to as a “layer”.
 Generally three layers are involved in the application namely Presentation Layer,
Business Layer and Data Layer
 Presentation Layer: It is also known as Client layer. Top most layer of an application.
This is the layer we see when we use a software. By using this layer we can access the
webpages. The main functionality of this layer is to communicate with Application layer.
This layer passes the information which is given by the user in terms of keyboard actions,
mouse clicks to the Application Layer.
For example, 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.
 In a simple words, it is to view the application.
 Application Layer: It is also known as Business Logic Layer which is also known as
logical layer. As per the gmail login page example, once user clicks on the login button,
Application layer interacts with Database layer and sends required information to the
Presentation layer. It controls an application’s functionality by performing detailed
processing. This layer acts as a mediator between the Presentation and the Database
layer. Complete business logic will be written in this layer.
 In a simple words, it is to perform operations on the application.
 Data Layer: The data is stored in this layer. Application layer communicates with
Database layer to retrieve the data. It contains methods that connects the database and
performs required action e.g.: insert, update, delete etc.
 In a simple words, it is to share and retrieve the data.

2 Collected by Bipin Timalsina

https://genuinenotes.com
https://genuinenotes.com
Unit-7/ Java Programming-II

One Tier Architecture:


One Tier application also known as Standalone application
One tier architecture has all the layers such as Presentation, Business, Data Access layers in a
single software package. Applications which handles all the three tiers such as MP3 player, MS
Office are come under one tier application. The data is stored in the local system or a shared
drive.

3 Collected by Bipin Timalsina

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.

4 Collected by Bipin Timalsina

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.

5 Collected by Bipin Timalsina

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

6 Collected by Bipin Timalsina

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

Figure: Enterprise architecture


 An Enterprise JavaBeans (EJB) container manages the execution of all enterprise beans
for one J2EE application. Enterprise beans and their container run on the J2EE server.
EJB is specification for making server side components that enable and simplifies the
task of creating distributed objects. EJB is a server-side software
component that encapsulates business logic of an application
 A web container manages the execution of all JSP page and servlet components for one
J2EE application. Web components and their container run on the J2EE server.
 An application client container manages the execution of all application client
components for one J2EE application. Application clients and their container run on the
client machine.

7 Collected by Bipin Timalsina

https://genuinenotes.com
https://genuinenotes.com
Unit-7/ Java Programming-II

J2EE Application Servers


 An application server is a software framework that provides both facilities to create web
applications and a server environment to run them
 A J2EE application server is a readymade sophisticated application that will host and run
all the J2EE applications.
 Once you have a J2EE application server, you can start building and running enterprise
applications.
 A J2EE application server runs enterprise internet applications that are built using
standard J2EE technologies

Figure: J2EE Application Server Components


A J2EE application server comprises of a Web Container and an EJB Container. A container is
nothing but a runtime environment to manage the application components. In J2EE, there are two
mainstream technologies like Servlets/JSP/Struts and EJB.
 Application components built using Servlet/JSP/Struts technologies run within Web
container, and application components built using EJB technology are run within EJB
container.
 You cannot run EJB components in Web container and Servlets/JSP components in an
EJB container, ok. All the remaining technologies (JDBC, JMS, JNDI(Java Naming and
Directory Interface), Spring, Hibernate etc) are like helper technologies that are used by
the above two mainstream technologies in both the containers.
An application server has both Web container and EJB container. If our application doesn’t use
EJB technology, do we need an EJB container? You are right. We don’t need an EJB container.
In such cases, having just a web container is good enough. (Example: Apache Tomcat, Jetty )
Some examples of fully compliant J2EE application servers are: GlassFish Server , IBM
WebSphere Application Server , Wildfly, JBoss Application Server, Apache TomEE etc.

8 Collected by Bipin Timalsina

https://genuinenotes.com

You might also like