J2EE Multitier Architecture
Last Updated :
10 Jan, 2025
A tier is an abstract concept that defines a group of technologies that provide one or more services to its clients. In multi-tier architecture, each tier contains services that include software objects, DBMS, or connectivity to legacy systems. IT departments of corporations employ multi-tier architecture because it's a cost-effective way to build an application that is flexible, scalable, and responsive to the expectations of clients.
N TIER MULTITIER ARCHITECTUREThe functionality of the application is divided into logical components that are associated with a tier. Each component is a service that is built and maintained independently of the other services. Services are bound together by a communication protocol that enables service and sends information from and to other services.
Multi-Tier Architecture
Multi-tier architecture is composed of:
- Clients: It Refers to a program that requests service from a component.
- Resource: A resource is anything a component needs to provide a service.
- Component: It is part of a tier that consists of a collection of classes or a program that performs a function to provide a service.
- Containers: It is software that manages a component and provides system services to the component. A container handles persistence, resource management, security, threading, and other system-level services from components that are associated with the container. Example: APIs.
J2EE Architecture
J2EE is a four-tier architecture that consists of:
- Client Tier/ Presentation Tier
- Web Tier
- Enterprise JavaBeans Tier/ Business Tier
- Enterprise Information Systems Tier
These tiers are explained in detail below.
1. Client Tier/Presentation Tier
It consists of programs that interact with the users. These components prompt the user for the input conversion as
a request to forward to software on the component that processes the request and returns the result to the client program. Components under Client tier in J2EE Specification:
- Applet Client- It is a component used by Web clients that operate within Applet Container. It is a Java-enabled web browser.
- Application Client –It is a Java application that operates within the application container. It is the Java Runtime Environment (JRE).
- Rich client- This does not come under J2EE Specification. This is not considered a component of the client because it can be written in a language other than Java. J2EE does not define containers for Rich clients but these clients access any tier in the environment using HTTP, SOAP, and ebXML protocols.
- Clients are classified by the technology used to access the components and resources.
Categories of Client Tier: There are 5 categories of clients
- Web Client,
- Java Beans Client
- EIS Client
- Web-service peers and
- Multi-tier client.
2. Web Tier
It provides the Internet functionality to the J2EE application. The components on the web tier use HTTP to receive requests and send responses to the client that resides on the tier. Web-Tier Provides services to Client-tier using HTTP. The responsibilities act as an intermediary between components working on the web tier and other tiers and the client tier. The intermediary activities are:
- Accepting info from other s/w sent using POST, GET, and PUT using HTTP.
- Transmit data such as images and dynamic content.
Components of Web Tier: Two components that work on the web tier are mentioned below:
- Servlets
- Java server pages (JSP)
3. Enterprise Java Beans Tier Implementation
It contains business logic for J2EE applications. In this tier two or more EJB reside. It is a core component for every J2EE Application.
- EJB beans are managed by the EJB server- which is a distributed object server that works on the EJB tier and manages transactions, and security, and ensures multi-threading and persistence when EJB are accessed.
- EJB tier provides key features such as concurrency, scalability, life cycle management, and fault-tolerant ( Back-Up) to the J2EE applications.
- EJB server and EJB container together handle low-level-systemservice required for implementing business logic in J2EE applications.
Some of the system services include Resource Pooling, Distributed object protocols, thread management, State Management, Process Management, Object persistence, Security, and Deployment Configuration.
4. Enterprise Information System Tier
EIS tier links the J2EE application to resources and legacy systems that are available on the corporate backbone network. It is the tier where the J2EE applications directly or indirectly interface with a variety of technologies including DBMS and Mainframes. Components on the EIS communicate to resources using CORBA or Java Connectors.
Access Control List (ACL)
- It controls communication between tiers.
- It acts as a bridge on different virtual networks because it adds security to web Applications.
- ACL prevents hackers to access DBMS and similar resources.
EIS-Tier provides connectivity to the resources that are not part of J2EE- which includes resources such as Legacy Systems, DBMS, and systems provided by third-party. Provides flexibility to developers to connect resources that are not part of J2EE using CORBA and Java Connectors or through proprietary protocols.
Similar Reads
Servlet Architecture
Servlets are grouped under the Advanced Java tree that is used to create dynamic web applications. Servlets are robust, well scalable, and are primarily used in developing server-side applications. If we go a little back in time, we would be able to witness that before the introduction of servlets,
5 min read
JSP Architecture
JSP architecture gives a high-level view of the working of JSP. JSP architecture is a 3 tier architecture. It has a Client, Web Server, and Database. The client is the web browser or application on the user side. Web Server uses a JSP Engine i.e; a container that processes JSP. For example, Apache T
3 min read
JPA - Architecture
JPA (Java Persistence API, sometimes also referred to as Jakarta Persistence API) is a tool to connect Java applications with databases for optimizing memory storage for data, thus providing a smoother User Experience (UX). In simple terms, JPA simplifies database access from within the Java applica
4 min read
Monolithic vs. Microservices Architecture
In software development, how you structure your application can have a big impact on how it works and how easy it is to manage. Two common ways to structure software are called monolithic and microservices architectures. In this article, we'll explore the differences between these two approaches and
3 min read
Spring Framework Architecture
The Spring framework is a widely used open-source Java framework that provides a comprehensive programming and configuration model for building enterprise applications. Its architecture is designed around two core principles: Dependency Injection (DI) Aspect-Oriented Programming (AOP)The Spring fram
7 min read
Hexagonal Architecture in Java
As per the software development design principle, the software which requires the minimum effort of maintenance is considered as good design. That is, maintenance should be the key point which an architect must consider. In this article, one such architecture, known as Hexagonal Architecture which m
6 min read
Java Multiple Choice Questions
Java is a widely used high-level, general-purpose, object-oriented programming language and platform that was developed by James Gosling in 1982. Java Supports WORA(Write Once, Run Anywhere) also, it defined as 7th most popular programming language in the world.Java language is a high-level, multi-t
3 min read
What are the Deployment Challenges in Monolithic Architecture?
Monolithic Architecture is like a big container, where all the software components of an app are created and tightly coupled, that is each component is fully dependent on the other. For example, you are developing an e-commerce site and there any many modules in it like the below image. As you can s
5 min read
Why the World is Moving Towards Microservices Architecture?
Imagine you run an organization called XYZ and let's say you have a requirement right now that you want to create an "Employee and Customer Management System". And let's say you have few people who purchase your services like your clients/customers. So they talk with you about the requirements and a
7 min read
Spring - Multi Action Controller with Example
Spring is one of the most popular Java EE frameworks. It is an open-source lightweight framework that allows Java EE 7 developers to build simple, reliable, and scalable enterprise applications. This framework mainly focuses on providing various ways to help you manage your business objects. It made
4 min read