ENTERPRISE JAVA
UNIT-1
CHAPTER-2
• JAVA EE ARCHITECTURE
• Java EE Server
• Java EE Containers
By
Prof. Sandeep Vishwakarma
Java EEArchitecture
•Java EE Platform is designed to help
developers create large scale,multi-
tiered,scalable,reliable and secure network
applications. A distributed, multi-tiered,
application model can be described as an
enterprise application as these applications
are designed to solve the problems
encountered by large enterprises.
Following Factors must be considered
Scalability: The capability of an application to adapt to any new
hardware environment.
Availability: The ability of an application to cater to the
increased demands from clients.
Extensibility: The ability of an application to incrernentally add
features from time to time to improveperformance and provide
better functionality to the client.
Maintainability: The ability of an application to respond to bug-
fixes with the minimum utilization of in terms of people, time and
technology.
Security: The ability of an application to maintain the integrity of
data.
Performance: The ability of an application to respond to a client
request in the minimum time.
Enterprise architecture is divided into following tiers
• Client Tier Services run on Client Machine.
• Web Tier Services run on the Java EE
Server.
• Business Tier Services run on the Java EE
Server.
• Enterprise Information System Services run
on the Database Server Machine.
Types of SystemArchitecture
•Single Tier Architecture
•Two Tier Architecture
•3-Tier Architecture
•Multitier Architecture
Single TierArchitecture:
Some applications are written to run on a single
computer. All the services provided by the
application i.e. the user interface, persistent data
access and the logic that processes the data input by
the user and read and displayed to the user from a
data store, all exist on the same physical machine
and are thus lumped together in the application.
 Hence in a Single-tier architecture:
• The user interface of a Web application i.e. the
presentation layer
• The middle ware i.e. the business rules
• The data access layer
Single Tier Architecture
Advantages:
• Simplestand least expensive alternative.
• Less equipment to purchase and maintain.
Disadvantages:
• This type of implementation is lower security and the
lack of scalability. An architecture is scalable when it
can be easily expanded or augmented to meet
increasing performance needs.
• Having all of the site's major components and data on
a single computer behind the domain firewall leaves
the site more vulnerable to malicious attacks.
• Running all of the site's components on a single
computer also limits expansion and optimization
possibilities.
Two TierArchitecture:
In this architecture, an application is divided into two
components:
Client
• Implements the user interface
• Contains business logic
Server
• Used to store and access business data, captured by
the user interface run on the
• Client in a data store at the Server
 Hence in a two-tier architecture:
• The User Interface is always physically located in the
user's desktop (i.e. the Client)
• The database management services are always
physically located on a Server
Two Tier Architecture
Advantages:
• Adds additional security by removing sensitive
customer data from the single computer
• Having the database on a separate computer
improves the overall performance of the site
• Allows optimizing each machine for more
specific performance requirements
Disadvantages:
• The increased cost and complexity of the
architecture
3-TierArchitecture:
 These are classified into 3 layer.
• User Services - Presentation Layer: Provides service
such as the Graphical User Interface and other
automation tasks that the application has to perform
• Business Services - Business Layer: Implements
business rules. This layer encapsulates the business logic
from users such that they need not know how business
logic is applied when business is upgraded, only the
business layer is affected and must be upgrade the rest of
the application services can remain untouched.
• Data Services - Data Layer: Provides data availability
and integrity. It is responsible for adding, modifying and
deleting data from the data store.
3-Tier Architecture
Advantage:-
There are several benefits to using n-tier architecture for your
software.
• Secure: You can secure each of the three tiers separately using
different methods.
• Easy to manage: You can manage each tier separately, adding or
modifying each tier without affecting the other tiers.
• Scalable: If you need to add more resources, you can do it per
tier, without affecting the other tiers.
• Flexible: Apart from isolated scalability, you can also expand
each tier in any manner that your requirements dictate.
Disadvantage:-
• Performance: It seems a paradox that having the several
components split to allow better efficiency and performance may
result in the risk of lower performance.
MultitierArchitecture:
 Client Tier:
• The client tier includes the web components such as
Servlets, JSP or standalone Java Desktop applications.
• This tier provides dynamic interfaces to the middle tier.
 Middle Tier:
• This is also called as the server tier.
• In the middle tier enterprise beans and web services
encapsulate distributable business logic for the
applications which are reusable.
• The JEE application server contains the server-tier
components which provides the platform for these web
components for actions to be performed and data to be
stored / persisted.
MultitierArchitecture….Continue:
 Enterprise data tier:
• The enterprise level data is stored / persisted
preferably or typically in a relational database.
• In this tier, the JEE applications comprises of
components, containers and services.
• All the web components (Servlets, JSP) provide
dynamic requests and responses from a web page.
• The EJB components contain the server-side
business logic for enterprise applications.
Java EE Server:
• A Java EE server is a server application that
implements the Java EE platform APIs and provides
the standard Java EE services.
• Java EE servers are sometimes called application
servers, because they allow you to serve application
data to clients, much like web servers serve web
pages to web browsers.
• Java EE servers host several application component
types that correspond to the tiers in a multi-tiered
application.
• The Java EE server provides services to these
components in the form of a container
Java EE Containers:
• Java EE containers are the interface between
the component and the lower-level
functionality provided by the platform to
support that component.
• The functionality of the container is defined by
the platform, and is different for each
component type.
• The server allows the different component
types to work together to provide functionality
in an enterprise application.
• The Java EE security model lets you configure a web
component or enterprise bean so that system resources
are accessed only by authorized users.
• The Java EE transaction model lets you specify
relationships among methods that make up a single
transaction so that all methods in one transaction are
treated as a single unit.
• JNDI lookup services provide a unified interface to
multiple naming and directory services in the enterprise
so that application components can access these services.
• The Java EE remote connectivity model manages low-
level communications between clients and enterprise
beans. After an enterprise bean is created, a client invokes
methods on it as if it were in the same virtual machine.
 Container Services
Java EE Container
Container Types:
There are three types of containers
• The Web Container
• The Application Client Container
• The EJB Container
The Web Container:
• The web container is the interface between web
components and the web server.
• A web component can be a servlet, a Java
Server Faces Facelets page, or a JSP page.
• The container manages the component's
lifecycle, dispatches requests to application
components, and provides interfaces to context
data, such as information about the current
request.
TheApplication Client Container:
• The application client container is the interface
between Java EE application clients, which are
special Java SE applications that use Java EE
server components, and the Java EE server.
• The application client container runs on the
client machine, and is the gateway between the
client application and the Java EE server
components that the client uses.
The EJB Container:
• The EJB container is the interface between
enterprise beans, which provide the business
logic in a Java EE application, and the Java EE
server.
• The EJB container runs on the Java EE server
and manages the execution of an application's
enterprise beans
enterprisejavaunit-1chapter-2-210914075956.pdf

enterprisejavaunit-1chapter-2-210914075956.pdf

  • 1.
    ENTERPRISE JAVA UNIT-1 CHAPTER-2 • JAVAEE ARCHITECTURE • Java EE Server • Java EE Containers By Prof. Sandeep Vishwakarma
  • 2.
    Java EEArchitecture •Java EEPlatform is designed to help developers create large scale,multi- tiered,scalable,reliable and secure network applications. A distributed, multi-tiered, application model can be described as an enterprise application as these applications are designed to solve the problems encountered by large enterprises.
  • 3.
    Following Factors mustbe considered Scalability: The capability of an application to adapt to any new hardware environment. Availability: The ability of an application to cater to the increased demands from clients. Extensibility: The ability of an application to incrernentally add features from time to time to improveperformance and provide better functionality to the client. Maintainability: The ability of an application to respond to bug- fixes with the minimum utilization of in terms of people, time and technology. Security: The ability of an application to maintain the integrity of data. Performance: The ability of an application to respond to a client request in the minimum time.
  • 4.
    Enterprise architecture isdivided into following tiers • Client Tier Services run on Client Machine. • Web Tier Services run on the Java EE Server. • Business Tier Services run on the Java EE Server. • Enterprise Information System Services run on the Database Server Machine.
  • 6.
    Types of SystemArchitecture •SingleTier Architecture •Two Tier Architecture •3-Tier Architecture •Multitier Architecture
  • 7.
    Single TierArchitecture: Some applicationsare written to run on a single computer. All the services provided by the application i.e. the user interface, persistent data access and the logic that processes the data input by the user and read and displayed to the user from a data store, all exist on the same physical machine and are thus lumped together in the application.  Hence in a Single-tier architecture: • The user interface of a Web application i.e. the presentation layer • The middle ware i.e. the business rules • The data access layer
  • 8.
  • 9.
    Advantages: • Simplestand leastexpensive alternative. • Less equipment to purchase and maintain. Disadvantages: • This type of implementation is lower security and the lack of scalability. An architecture is scalable when it can be easily expanded or augmented to meet increasing performance needs. • Having all of the site's major components and data on a single computer behind the domain firewall leaves the site more vulnerable to malicious attacks. • Running all of the site's components on a single computer also limits expansion and optimization possibilities.
  • 10.
    Two TierArchitecture: In thisarchitecture, an application is divided into two components: Client • Implements the user interface • Contains business logic Server • Used to store and access business data, captured by the user interface run on the • Client in a data store at the Server  Hence in a two-tier architecture: • The User Interface is always physically located in the user's desktop (i.e. the Client) • The database management services are always physically located on a Server
  • 11.
  • 12.
    Advantages: • Adds additionalsecurity by removing sensitive customer data from the single computer • Having the database on a separate computer improves the overall performance of the site • Allows optimizing each machine for more specific performance requirements Disadvantages: • The increased cost and complexity of the architecture
  • 13.
    3-TierArchitecture:  These areclassified into 3 layer. • User Services - Presentation Layer: Provides service such as the Graphical User Interface and other automation tasks that the application has to perform • Business Services - Business Layer: Implements business rules. This layer encapsulates the business logic from users such that they need not know how business logic is applied when business is upgraded, only the business layer is affected and must be upgrade the rest of the application services can remain untouched. • Data Services - Data Layer: Provides data availability and integrity. It is responsible for adding, modifying and deleting data from the data store.
  • 14.
  • 15.
    Advantage:- There are severalbenefits to using n-tier architecture for your software. • Secure: You can secure each of the three tiers separately using different methods. • Easy to manage: You can manage each tier separately, adding or modifying each tier without affecting the other tiers. • Scalable: If you need to add more resources, you can do it per tier, without affecting the other tiers. • Flexible: Apart from isolated scalability, you can also expand each tier in any manner that your requirements dictate. Disadvantage:- • Performance: It seems a paradox that having the several components split to allow better efficiency and performance may result in the risk of lower performance.
  • 16.
    MultitierArchitecture:  Client Tier: •The client tier includes the web components such as Servlets, JSP or standalone Java Desktop applications. • This tier provides dynamic interfaces to the middle tier.  Middle Tier: • This is also called as the server tier. • In the middle tier enterprise beans and web services encapsulate distributable business logic for the applications which are reusable. • The JEE application server contains the server-tier components which provides the platform for these web components for actions to be performed and data to be stored / persisted.
  • 17.
    MultitierArchitecture….Continue:  Enterprise datatier: • The enterprise level data is stored / persisted preferably or typically in a relational database. • In this tier, the JEE applications comprises of components, containers and services. • All the web components (Servlets, JSP) provide dynamic requests and responses from a web page. • The EJB components contain the server-side business logic for enterprise applications.
  • 19.
    Java EE Server: •A Java EE server is a server application that implements the Java EE platform APIs and provides the standard Java EE services. • Java EE servers are sometimes called application servers, because they allow you to serve application data to clients, much like web servers serve web pages to web browsers. • Java EE servers host several application component types that correspond to the tiers in a multi-tiered application. • The Java EE server provides services to these components in the form of a container
  • 20.
    Java EE Containers: •Java EE containers are the interface between the component and the lower-level functionality provided by the platform to support that component. • The functionality of the container is defined by the platform, and is different for each component type. • The server allows the different component types to work together to provide functionality in an enterprise application.
  • 21.
    • The JavaEE security model lets you configure a web component or enterprise bean so that system resources are accessed only by authorized users. • The Java EE transaction model lets you specify relationships among methods that make up a single transaction so that all methods in one transaction are treated as a single unit. • JNDI lookup services provide a unified interface to multiple naming and directory services in the enterprise so that application components can access these services. • The Java EE remote connectivity model manages low- level communications between clients and enterprise beans. After an enterprise bean is created, a client invokes methods on it as if it were in the same virtual machine.  Container Services
  • 22.
  • 23.
    Container Types: There arethree types of containers • The Web Container • The Application Client Container • The EJB Container
  • 24.
    The Web Container: •The web container is the interface between web components and the web server. • A web component can be a servlet, a Java Server Faces Facelets page, or a JSP page. • The container manages the component's lifecycle, dispatches requests to application components, and provides interfaces to context data, such as information about the current request.
  • 25.
    TheApplication Client Container: •The application client container is the interface between Java EE application clients, which are special Java SE applications that use Java EE server components, and the Java EE server. • The application client container runs on the client machine, and is the gateway between the client application and the Java EE server components that the client uses.
  • 26.
    The EJB Container: •The EJB container is the interface between enterprise beans, which provide the business logic in a Java EE application, and the Java EE server. • The EJB container runs on the Java EE server and manages the execution of an application's enterprise beans