module 1 enterprise java technologies. enterprise java technologies topics to be covered:...

50
Module 1 Enterprise Java Technologies

Post on 21-Dec-2015

251 views

Category:

Documents


3 download

TRANSCRIPT

Module 1

EnterpriseJava Technologies

Enterprise Java Technologies

Topics to be Covered:• Environment & Architecture• Java EE Platform Specification• Java EE Technologies

Enterprise Java Technologies

Environment &Architecture

Java Environments

• Four Major Types of Java Environments– Work Station/Desktop/Server– Personal Java -> CDC (Connected

Device Configuration)– Java SE for Embedded – Java Card

Platform Editions

• Three platform editions– Standard Edition (Java SE)– Enterprise Edition (Java EE)– Micro Edition (Java ME)

Evolution of Java

Oak Java 1.02

Java 2 SDK,v.1.2,

1.3, …Java 1.1

Embedded Java Personal Java

Java SE Java EE Java ME

CDC CLDC

MIDP

Java Technologies and Resources

• “The source for Java technology”– http://java.sun.com

• Technology Overviews– Java SE

•http://www.oracle.com/technetwork/java/javase/overview/index.html

– Java EE•http://www.oracle.com/technetwork/java/

javaee/overview/index.html– Java ME

•http://www.oracle.com/technetwork/java/javame/overview/index.html

Object-Oriented Language

Small Talk

Single inheritanceEasy-to-Compile

Pascal

Semi-compilation

C++

Lessons Learned

Java

The Java Package

Class

Class

Methods

Properties

Packagejava.awt.*

The Java Package

• Packages map to the directory structure of host system.

• Java classes are found using a fully referenced class name– java.lang.Object– com.xyz.net.Socket

The Java Package

Socket

Root Directory

com

xyz

net

Socket

Java’s Key Packages

Package Name Descriptionjava.applet Applet classes

java.awt Heavyweight GUI classes

java.beans JavaBeans support API

java.io Input/Output classes

java.lang Java Core classes

java.math Arbitrary Precision arithmetic

java.net Networking classes

java.rmi Remote method invocation

java.sql JDBC classes

java.util Utility classes

javax.swing Lightweight GUI classes

Definition of Java

• From The Java Language: A White Paper

– Java: A simple, object-oriented , distributed, interpreted, robust, secure, architecture neutral, portable, high performance, multithreaded, network-ready and dynamic language

Definition of Java

• From The Java Language: A White Paper

– Java credo: “Write Once – Run Anywhere”

– Java goals: Platform independent, extensible, easy-to-program language that takes advantage of the inherent distributed infrastructure of the Internet.

Portable and Platform Independent

• ‘Write Once, Run Anywhere” depends on:– A processor or code engine– A uniform run-time environment

Portable and Platform Independent

• The Java Virtual Machine– Guarantees programs run the same

on all platforms– Standardizes data type size– Has stack-based architecture– Is an emulator

Portable and Platform Independent

• The Java Runtime Environment– Shields platform specific issues– Establishes security mechanism– Loads required classes– Compatibility requirements

Portable and Platform Independent

Native OS

Java Support Classes

JVM Executable

Java Runtime Environment

Platform Independent

– Bytecode

Java source Bytecode

Development Deployment

compiler JREJVM

Three-Tier Architecture

• Data management– handles data storage

• Business logic– implements business rules

• User presentation– format and Display

Three-Tier architecture

The Enterprise

User Interface

Logic

Data Management

Motif Windows Telephony

BusinessRules

BusinessRules

BusinessRules

DataService

DataService

DataService

Three-Tier Architecture

• Advantages – business rules treated as assets– thin client– business logic can be shared– reusable parts– solution for Web-based applications

Web Platform Solution

• Web application adheres to three-tiered model– user presentation

• web browser and web server– business logic

•application server– data management

•enterprise information system

Web Platform Solution

Java

Application Server

Application Server

Presentation& Business Logic

Servlet/JSPEJBs, RMI Objects

JDBC

Internet

Browser

Web Server

Enterprise Java Technologies

Java EE PlatformSpecification

Java EE Platform Specification

• Provides all Java SE APIs• Requires additional optional packages

or standard extensions• Four containers supported

– application client containers– applet containers– web containers– enterprise bean containers

Application Components

Applet Container

Applet

Java SE

ApplicationClient

Container

ApplicationClient

Java SE

JDBCJAXPJAASJMS

Database

Web Container

JSP Servlet

JMSJAXPJAASJTA

Java MailJCA

JDBC

Java SE

EJB Container

EJB

JMSJAXPJAASJTA

Java MailJCA

JDBC

Java SE

HTTPSSL

Application Components

• Component Types– Application Client– Applets– Web Components

•Servlets•JSP

– Enterprise JavaBeans

Server Support for Application Components• Server Support

– Complete Dependence•Deployment, Management, & Execution

– Web Components– EJBs

– Partial Dependence•Deployment and Management on Server

•Loaded to and Executed on Client– Applets

– Dependence not clearly defined–Application Components

Containers

• Runtime Support• Gateway to Java EE APIs• Mediates communication between

different application components• Transparently provides configuration

management through deployment descriptor settings

• Must provide a Java Compatible Runtime Environment

Java EE Objectives

• Integrated support for web components and enterprise beans

• Common naming context (JNDI ENC)• Declare resources using XML

deployment descriptor• JAR packaging technology

– .war (Web Archive)– .ear (Enterprise Archive)

• Access to a common transaction object

Java EE Software Standards

• Java Database Connectivity (JDBC)– database connectivity

• Java Remote Method Invocation (RMI)– remote object communications

•RMI-IIOP•RMI-JRMP

• Java Naming and Directory Interface (JNDI)– naming locator for remote objects

• Java Transaction API (JTA)– transaction support

Java EE Software Standards

• Java Message Service (JMS)– message-oriented middleware

services• HTTP and HTTPS• Servlets

– server-side request-reply component• JavaServer Pages (JSP)

– Java embedded in a Web page• Java API for XML Parsing (JAXP)• Java Connector Architecture (JCA)

Java EE Software Standards

• Enterprise JavaBeans Architecture (EJB)– Session

•stateless•stateful

– Entity•Java Persistence API•container-managed

– Message-driven•invoked by a JMS message

Enterprise Java Technologies

Java EE Technologies

Java Servlets – Static ContentREQUEST

REPLY

Java Servlets – Dynamic ContentREQUEST

REPLY “On the Fly”

Java Servlets

• Enhances server capability– Perform calculation– Access DBs

• Component which implements javax.servlet.Servlet interface

• Managed and invoked by Java EE Servlet container

• Containers provide session management

• Incorporate JavaBean components

JavaServer Pages (JSPs)

• Dynamically generate web content• HTML-based text documents with

sections of Java code (scriptlets) embedded

• Servlet generated from JSP on first access

• Web designers create and manipulate HTML, XML, etc. parts of the page

• Java developers create and manipulate Java code

JavaServer Pages (JSPs)JSP REQUEST

GENERATE HTML

JSP1st REQUEST COMPILE TO

SERVLET

10011…

<HTML>…

</HTML>

<HTML>…

</HTML>

HTML

ALL SUBSEQUENTREQUESTS

SERVLET

JavaServer Faces (JSF)

• Provides a component-based API to build a robust, rich server-side user interface for web applications– HTML: Good set of user interface

components– Applets: Better set, but must be

downloaded and executed on client– Developer time spent retrieving and

validating request parameters, and passing parameters to business logic

JavaServer Faces (JSF)

• JSF components handle all the complexity of managing the user interface– Developer can focus on business logic– JSF components do not directly

generate specific presentation code•Custom renderers create client presentation code

– JSF components connect to application data sources

– JSF connects client-generated events to event handlers on the server

Java Database Connectivity (JDBC)

• Connect web applications with back-end data sources

• Common API works with various DBs through a system-specific driver

Enterprise JavaBeans

• Entity Beans– Model Business Concepts

•customer•piece of equipment•an item in inventory

• Session Beans– Models Business Processes

•stock market purchase•hotel reservation

Enterprise JavaBeans

• Message-driven Beans– Models Business Processes– Similar in purpose to session beans

•coordinates tasks•receives messages asynchronously

Web Services

• Endpoints the provide web applications with server-side business rules

• From World Wide Web Consortium (W3C):

A Web service is a software system design to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP message, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.

Web Services

• JAXR API (Java API for XML Registries)– Accesses WSDL definitions published

by XML Registries• JAX-RPC API (Java API for XML-based

Remote Procedure Calls)– Allows client application to invoke a

Web Service• Java EE architecture supports a

component model for easily deploying web services (JAX-WS)

Transaction Support and Security

• Transactions– Set of activities that will collectively

succeed or fail– EJB container provides built-in

support for managing transactions• Security

– Authentication– Authorization

•User roles

Enterprise Java Technologies

Topics Covered:• Environment & Architecture• Java EE Platform Specification• Java EE Technologies