Professional Documents
Culture Documents
J2EE
NIIT CATS
Introduction to J2EE
• The Java 2 Platform, Enterprise Edition (J2EE) defines the standard
for developing multi-tier enterprise applications.
• J2EE simplifies enterprise applications by
– basing them on standardized, modular components
– by providing a complete set of services to those components
– by handling many details of application behavior automatically, without
complex programming
Client HTTP
Browser
A Servlet JDBC
Database
HTTP
Client Web
Browser Server
B
Solution: (Contd…) Servlets
• Servlets are:
– Java Components on the Web Server
– Used for generation of dynamic content
– Output can be HTML, XML, WML, or any other content
type
HTTP
Requirement: 3
• MaxMoney Bank has ATMs in all major
cities across the globe.
• They have a central database in Chicago.
• The bank wants to create a distributed
application (which is NOT Web based) that
will allow its customers to access an
account with the bank.
Solution: RMI
• The ideal solution in this scenario would be to
– have the clients access and submit information using
the client application
– information will be validated by components hosted on
a server
– Server, in turn (if the data submitted meets all the
business rules), will create a connection with the
database server and submit the data
– To keep the load on the database server optimized, the
application will need to be distributed across the
network.
Solution: (Contd…) RMI
RMI-Clients invoke the methods stored on the RMI-
Server which accepts the request and retrieves
information from the centralized database at
Chicago
RMI
Client
A JDBC
RMI
Database
Server
RMI
Client
B
Solution: (Contd…) RMI
• RMI is a specification that enables one Java
Virtual Machine (JVM) to invoke methods in an
object located in another Java Virtual Machine
(JVM).
• These two JVMs could be running on different
computers or running as separate processes on
the same computer.
• RMI is implemented on the middle-tier of the
three-tier architecture framework, thereby
facilitating the programmers to invoke distributed
components across a networked environment.
Requirement: 4
• MaxMoney bank wants to enhance the
ATM application.
• A customer should be able to do multiple
transactions (cash withdrawal, request for
account summary etc.) once he has logged
into the ATM.
Solution: EJB
• The application needs to be designed to
validate the card information entered by the
user, and this information, if valid, must be
carried over until the user leaves ATM.
• Considering that the information must be
retained while the user traverses across
screens, it is best suited to create an EJB.
Solution: (Contd…) EJB
EJB is a specification for creating server-side
components that enables and simplifies the
task of creating distributed objects
EJB
Client
A EJB JDBC
Database
EJB
EJB
Client
Container
B
Solution: (Contd…) EJB
• EJB components are server-side
components written using Java
• EJB components implement the business
logic only
• EJB components provide services, such as
transaction and security management
• EJB can maintain state information across
various method calls
Requirement: 5
• MaxMoney bank wants to enhance their
banking services by:
– allowing customers to view their account
information on their mobile devices.
– allowing a customer to do transactions such as
balance transfer, request for cheque books
etc.) once he has logged into the bank server
using their mobile devices.
Solution: J2ME
• Java 2 Micro Edition (J2ME) is a modular and customized
platform from Sun that handles the computing requirements
of wireless\mobile devices such as mobile phones, Personal
Digital Assistants (PDAs), and other electronic and
embedded devices with as little as 128 KB of RAM and with
processors that are less powerful than desktop computers.
• Some of the features of J2ME are as follows:
– Portability
– Built-in consistency across products\
– Security over the network
– Compatibility with J2SE and J2EE platforms
Solution: (Contd…) J2ME
• J2ME Architecture
– J2ME consists of two major components,
profiles and configurations. A profile is a
specification of a set of Java APIs for a
particular category of handheld devices. It
also includes the specification of Java Virtual
Machine that is required for running
applications in a particular device. There are
various types of profiles, they are:
• Mobile Information Device Profile (MIDP)
• Foundation Profile
• PDA Profile
Solution: (Contd...) J2ME
– Configuration, on the other hand, specifies the
basic J2ME run-time environment. It also
includes a collection of classes from J2SE.
Profiles are implemented on configurations.
Requirement: 6
• Other integral requirements of any real-
time enterprise solution are:
– Messaging Service
– Transaction management
Solution: Messaging Service
• The components in a message-based application send
messages to a message server.
• The message server, in turn, delivers the messages to the
specified recipients.
• The message service model is much like the model behind
the postal service
Solution: (Contd…) Transaction
Service
The transaction is completed when all the sub-
transactions are also completed individually
Complete Transaction
Requirement: 7
• Prior to building the application, architecture
provides a preview of the application. A good
architecture helps to reduce the risk factors, such
as increased development cost associated with
the application.
• Architecture is also needed to support the
service-level requirements, such as performance,
scalability, extensibility, maintainability,
manageability, and security of a system.
• Therefore, architecture represents a higher level
of abstraction than design, providing less details
of implementation.
Solution: J2EE Architecture
• J2EE architecture is defined as the study of designing
J2EE applications. The application design involves
deciding on the type of components to be used, such
as Java Server Pages (JSP), Enterprise Java Bean
(EJB), Java Message Service (JMS), servlets, and the
hardware that will be required to run the components.
• Developing architecture for a J2EE project involves
object-oriented analysis of the J2EE components.
Solution: (Contd…) J2EE
Architecture
• The J2EE architecture contains the client tier,
presentation tier, business tier, and the data tier. The
Web browser is the client that runs in client
components, the presentation tier contains the Web
components, the business tier contains the business
components, and the data tier contains the data
stores
Solution: (Contd…) J2EE
Architecture
• A J2EE architect plays a key role in
developing such systems by performing high
level planning and business modeling while
focusing on non-functional requirements and
risk management.
• A J2EE architect uses different approaches
to create the architecture depending on the
size of the project and the project
constraints.
J2EE Components and
Services
All the technologies/services of J2EE can be viewed
together in the following diagram:
Thank You