Session 01

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 41

Session:

Objectives

 Explain enterprise applications


 Describe the problem faced by large enterprise applications
 Explain distributed application architecture used for developing
business components
 Describe Java EE platform and its API
 Describe application development architecture of enterprise
application
 Describe application server containers and their services
 List various Java EE application servers
 Describe Java EE profiles and the use of EJBLite on application
servers

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 2


Introduction

❑Java Enterprise Edition (Java EE) enables


enterprise application development on Java
platform.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 3


Enterprise Applications 1-2

What is an Enterprise application?

❑An enterprise application:


▪ Is a large business application.
▪ Is developed to fulfil the needs of large business domains
with complex functionalities.
▪ Is usually hosted on servers.
▪ Provides services to a large number of users over a
computer network.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 4


Enterprise Applications 2-2

❑ Following figure shows the process of enterprise


application development:

Understanding Developing the


Refining the
the problem desired
requirements
domain components

Assembling and
Deploying the
testing the
application
components

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 5


Need for Enterprise Applications 1-3

❑ Current Scenario:
▪ The rapid changes have made businesses to meet the
requirement of customers, communicate with other business
processes, and incorporate business-to-business services.

▪ Enterprise applications are developed to satisfy such


business needs.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 6


Need for Enterprise Applications 2-3

❑ Following figure shows some different types of domains


involving complex business functionalities:

Banking
Logistics
Finance
Production Scheduling
Order Management

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 7


Need for Enterprise Applications 3-3

Concerns and requirements of large businesses:


•Should be long lived applications performing parallel processing.
•Should be functional across platforms.
•Should support complex business processes and domain-based
constraints.
•Should follow procedures with respect to security, administration, and
maintenance of the applications.
•Should follow complex business requirements that are defined through
policies, constraints, rules, processes, and entities in the domain.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 8


Enterprise Application Architecture 1-5

 Application architecture divides application components into


tiers or layers based on their functionality in the environment.
 Following figure shows a typical client-server architecture:
Client tier – Is responsible
Server tier – Is for presentation of data
responsible for providing to the client.
data services to the client.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 9


Enterprise Application Architecture 2-5

 There is another variant of two tier architecture where the


client is a thick client.
 A thick client contains some business logic residing on it.
 A significant part of the executable code resides on the client-tier.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 10


Enterprise Application Architecture 3-5

 Some of the drawbacks with the client-server architecture


are as follows:
 If the server has multiple clients trying to access the server,
then there might be resource contention resulting in
response delays.
 Any changes in the user interface have to be updated at all
client nodes.

To overcome these problems, distributed application


architecture has been introduced.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 11


Enterprise Application Architecture 4-5

What is a Distributed application architecture?

Distributed application architecture:


 Divides the large monolithic application into layers.
 Introduces middleware layer whose main purpose is to
bridge the gap between different hardware systems.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 12


Enterprise Application Architecture 5-5

 Following figure shows distributed architecture of applications:

ClientI Tier
Initiates service
requests

Business Tier
Implements business
logics and
communicates with
clients

Enterprise
Information System
(EIS)
Holds all the data
pertaining to the
application
© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 13
Requirements of Distributed
Applications
 Reusability
 Remote methods
 Resource pooling
 Multi-user
 Access control
 Failover support
 Transactional
 Shared data
 Logging and auditing
 Security

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 14


Java in Enterprise Development
 Following figure shows different editions of Java used in
application development:

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 15


Java EE Platform Stack

 Java EE platform is the application environment where


developers can write Java enterprise applications.
 It comprises the following components:
 A set of specifications for the platform
 Implementation of specifications
 Java EE software development kit
 Java EE components and applications

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 16


Java EE Application Model 1-3

 Following are the application tiers implemented in


most applications:
 Client tier
 Middle tier which in turn may have a Web tier, business tier
 Enterprise Information Systems (EIS) tier

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 17


Java EE Application Model 2-3

 Following figure shows a graphical representation of distributed


multitier application model for enterprise applications in Java:

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 18


Java EE Application Model 3-3

Client tier comprises the Web tier is responsible


application clients or Web for handling
pages which access the communication of the
application. application components
over the Internet.

Business tier EIS tier comprises the


implements the business data repositories of the
logic of the application. application.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 19


EJB as Business Components 1-4

 EJBs are server-side components.


 EJBs can communicate with both the end user and the
database of the application.
 Processing of data is defined by the business
requirements of the application and implemented through
EJBs in case of Java.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 20


EJB as Business Components 2-4

 Following are the functions that can be carried out by


EJBs:

Implements business logic Access Database

Enables deployment and


Integrates with other execution of business
systems components in distributed,
multi-user environment

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 21


EJB as Business Components 3-4

 Remote components were earlier accessed through Remote


Method Invocation (RMI).

 Following are the steps based on which RMI is implemented:


 When a component has to access another component located over
the network, the client invokes a stub.
 Stub invokes the component through a skeleton.
 Skeleton extracts the parameters from the request and invokes
right methods to generate the response for the request received.
 Once the response is generated, the response is sent to the client.

 Some drawbacks of RMI are loss of object identity which creates


performance bottlenecks and so on.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 22


EJB as Business Components 4-4

 EJB overcomes the drawbacks of RMI and other


technologies like Common Object Request Broken
Architecture (CORBA) through component and container
framework model.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 23


Java EE Containers 1-6

 Java EE provides various underlying services for enterprise


application components through containers.
 Containers can be defined as an interface between the application
component and the underlying hardware/software on which the
component is residing.
 Containers provide various services to the enterprise application
components, such as transaction management, security, and so
on.
 Containers allows application developers to concentrate on the
business logic specific for the application, rather than
implementation of services for the application.
 All the application components are deployed into a container
before execution.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 24


Java EE Containers 2-6

 Following figure shows the different types of containers:

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 25


Java EE Containers 3-6

 The container in an enterprise application can be


categorized as:
Web container - Manages the
EJB container - Manages the
execution of dynamic Web
execution of enterprise beans
pages, Servlets, and other
on Java EE server.
Web components.

Categories of
container

Application client container -


Manages the execution of Applet container - Manages
application clients. the applets.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 26


Java EE Containers 4-6
 The services provided by the container to the application
component are:
• Provides security model by configuring the
Security container.

• Provides transaction support to the application


Transaction support component.

Java Naming and • Provides naming services to ensure that the objects
Directory service of the application are appropriately accessed.

Java EE • Provides low level communication between clients


communication model and enterprise beans.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 27


Java EE Containers 5-6

 The containers also manages enterprise bean and Servlet


lifecycle, database connection, resource pooling, data
persistence, and access to the Java EE platform APIs.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 28


Java EE Containers 6-6

 Apart from these services, J2EE container also provides


the following services to the applications it hosts:

Deployment services API based services

Java EE Container Services

Inherent services Vendor specific services

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 29


Java EE APIs and Services 1-3

 Following figure shows the


APIs provided by Java EE
7. The APIs highlighted in
yellow are the new ones
introduced in Java EE 7.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 30


Java EE APIs and Services 2-3

 Following are the commonly used APIs are as follows:


 Java Persistence API – Uses an object-relational mapping
approach to enable interaction between the beans and the
database.
 Java Transaction API – Sets the boundaries of the transactions in
the application and manages multiple transactions among the
components of the application.
 Java API for RESTful Web services – Defines APIs for the
development of Web services based on Representation State
Transfer architectural style.
 Contexts and Dependency injection – Defines a set of services
provided by the container to enable the enterprise beans to
function along with the JSF pages.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 31


Java EE APIs and Services 3-3

 Bean Validation – Defines a meta data model and an API


for validating Java bean components.
 Java Message Service API – Enables communication
between application components in a loosely coupled,
reliable, and asynchronous manner.
 Java EE Connecter Architecture – Used for system
integration to create resource adapters.
 Java Mail API – Provides interfaces for sending and
receiving e-mail notifications.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 32


Java EE 7 Software Development Kit

Is a pre-requisite
Acts as a base
for installation of
for Java
GlassFish server
application
and NetBeans
development.
IDE.

Has runtime
Has debuggers libraries and
and compilers basic
for java program components for
execution. executing Java
programs.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 33


Java EE Application Servers 1-3

 Application servers:
 Are entities of applications on which
enterprise applications are deployed
and run.
 Consists of components such as
database connectors, Web server
connectors, runtime libraries, and so
on.
 Comprise an EJB container and
Web container.
• All beans of an application are
deployed in the EJB container.
• Web components are deployed in
the Web container.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 34


Java EE Application Servers 2-3

 Following are the Java EE application servers:

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 35


Java EE Application Servers 3-3

 Java EE application is done in NetBeans IDE.


 NetBeans IDE is an integrated development environment
used for development in Java.
 Following figure shows the NetBeans IE interface:

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 36


Java EE Profiles 1-4

 A profile is a subset of the libraries of the Java Runtime


Environment and requires less compute resources.
 EJBLite is a Java EE profile defined on Java EE7 platform.
 EJBLite has the following features implemented:
 It implements all the three variants of session beans.
 It implements local EJB interfaces or no interfaces.
 Interceptors are part of EJBLite.
 It supports container managed and bean managed
transactions.
 The security mechanisms are declarative.
 Supports an Embedded API.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 37


Java EE Profiles 2-4

 Following table shows the comparison of the components


in EJB 3.1Lite and Complete EJB 3.1:
Components EJB 3.1Lite EJB 3.1

Session Yes Yes

Message- No Yes
Driven
2.x/1.x No Yes

Java Yes Yes


Persistence 2.0

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 38


Java EE Profiles 3-4

 Following table shows the comparison of the Session


Bean Client Views in EJB 3.1Lite and Complete EJB 3.1:
Session Bean EJB 3.1 Lite Complete EJB 3.1
Client Views
Local Yes Yes

No-interface Yes Yes

3.0 Remote No Yes


Interface
2.0 Remote No Yes
Interface
Web Service End No Yes
point
© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 39
Java EE Profiles 4-4

 Following table compares the services provided in the EJB


3.1Lite and Complete EJB 3.1:
Services EJB 3.1Lite EJB 3.1
Timer No Yes
Asynchronous No Yes
Session Beans
Interceptors Yes Yes
RMI-IIOP No Yes
interoperability
Transactions Yes Yes
Security Yes Yes
Embeddable API Yes Yes

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 40


Summary

 An enterprise application is a large business application. It is usually hosted on servers and


simultaneously provides services to a large number of users over a computer network.
 Application architecture divides application components into tiers or layers based on their
functionality in the environment.
 Distributed application architecture divides the large monolithic application into layers.
 As enterprise application execution is distributed across multiple tiers, there are various issues or
concerns with respect to the design of these applications.
 The purpose of Java EE platform is to build large scalable, multi user applications.
 The business logic of an application is implemented by EJBs by using various supporting APIs
provided by Java EE.
 EJB is based on component framework model where the application comprises communicating
components.
 Enterprise application components are deployed into containers that provide supporting services
such as transaction management, security, and so on to the application.
 Application servers are entities of applications on which enterprise applications are deployed and
run.
 EJBLite is a Java EE profile, which is a compact runtime environment including all the essential
application entities.

© Aptech Ltd. Enterprise Application Development in Java EE/Session 1 41

You might also like