cs6320 – j2ee l. grewe motivation: e-commerce and enterprise computing models four models for...

18
CS6320 – J2EE CS6320 – J2EE L. Grewe L. Grewe

Post on 22-Dec-2015

222 views

Category:

Documents


0 download

TRANSCRIPT

CS6320 – J2EECS6320 – J2EE

L. GreweL. Grewe

MOTIVATION: E-commerce and MOTIVATION: E-commerce and Enterprise Computing ModelsEnterprise Computing Models

Four models for e-commerce and Four models for e-commerce and enterprise computing:enterprise computing:• Business to businessBusiness to business• Business to customerBusiness to customer• Customer to customerCustomer to customer• Intra-businessIntra-business

Implementation technology has gone Implementation technology has gone through two-tier to component-based through two-tier to component-based n-tier architecture.n-tier architecture.

Why N-tier Systems ArchitectureWhy N-tier Systems Architecture

Different presentations of the same business Different presentations of the same business data.data.

Change the business logic, or database type or Change the business logic, or database type or schema without impacting the clients.schema without impacting the clients.

Hide middle tier (business logic) behind a firewall.Hide middle tier (business logic) behind a firewall. Database connection pools.Database connection pools. Selectively upgrade parts of the architecture Selectively upgrade parts of the architecture

without rewriting the entire application.without rewriting the entire application.

N-tier SystemsN-tier Systems

Java™2 Platform, Enterprise Java™2 Platform, Enterprise Edition (J2EE)Edition (J2EE)

J2EE is introduce to reduce the cost and J2EE is introduce to reduce the cost and complexity of developing n-tired enterprise complexity of developing n-tired enterprise applicationsapplications

J2EE defines a complete platform that guarantees J2EE defines a complete platform that guarantees services in such areas as:services in such areas as:• SecuritySecurity• Transaction ManagementTransaction Management• Resource ManagementResource Management• Naming and DirectoryNaming and Directory• MessagingMessaging• Concurrency controlConcurrency control• InteroperabilityInteroperability

J2EE ArchitectureJ2EE Architecture

The J2EE runtime environment The J2EE runtime environment consists of four major parts:consists of four major parts:• Application componentsApplication components• ContainersContainers• Resource manager driversResource manager drivers• Database supportDatabase support

J2EE Application ComponentsJ2EE Application Components

J2EE defines four application J2EE defines four application component types:component types:• Application clientsApplication clients• AppletsApplets• Servlets and JavaServer pages (JSP)Servlets and JavaServer pages (JSP)• Enterprise JavaBeans™ components Enterprise JavaBeans™ components

(EJB)(EJB)

J2EE ContainersJ2EE Containers

J2EE supports four separate types of containers, J2EE supports four separate types of containers, corresponding to the four types of components:corresponding to the four types of components:• Application client containersApplication client containers• Applet containersApplet containers• Web containersWeb containers• Enterprise bean containersEnterprise bean containers

All types of containers must provide Java 2 All types of containers must provide Java 2 Platform Standard Edition (J2SE) compatible Platform Standard Edition (J2SE) compatible runtime environmentruntime environment

J2EE ArchitectureJ2EE Architecture

Benefits of J2EE ArchitectureBenefits of J2EE Architecture

J2EE server core manages resources and J2EE server core manages resources and transactions and includes the java 2 platform virtual transactions and includes the java 2 platform virtual machinemachine

J2EE platform services may be implemented on a J2EE platform services may be implemented on a single system or distributed over disparate single system or distributed over disparate platforms.platforms.

J2EE-compliant servers guarantee the seamless and J2EE-compliant servers guarantee the seamless and correct execution of all components and correct execution of all components and middleware services.middleware services.

Developers do not need to manage the integration Developers do not need to manage the integration of service implementations from various vendors (it of service implementations from various vendors (it is the J2EE platform vendor’s responsibility).is the J2EE platform vendor’s responsibility).

Other benefits of J2EE ArchitectureOther benefits of J2EE Architecture

Service API are specified as Enterprise Java Service API are specified as Enterprise Java technology interfaces, which may be plugged technology interfaces, which may be plugged seamlessly into the serverseamlessly into the server

The application server provides services such as:The application server provides services such as:• Load balancingLoad balancing• ReplicationReplication• Database connection poolingDatabase connection pooling• Thread poolingThread pooling• CachingCaching

J2EE is vendor independent – Application builders can J2EE is vendor independent – Application builders can choose from a variety of server implementations.choose from a variety of server implementations.

Component-based Server Component-based Server DevelopmentDevelopment

The application server may be implemented using The application server may be implemented using reusable components.reusable components.

Server components:Server components:• Have well-defined business interfaces for their Have well-defined business interfaces for their

clients.clients.• Interact with the container through well-Interact with the container through well-

defined API.defined API. J2EE technology provides a set of vendor-J2EE technology provides a set of vendor-

independent programming interfaces for the independent programming interfaces for the implementation of the container (middle tier).implementation of the container (middle tier).

Component-based Server Component-based Server DevelopmentDevelopment

EJB technology forms one core of the EJB technology forms one core of the J2EE architecture.J2EE architecture.

Presentation logic is implemented Presentation logic is implemented using servlets and JSP.using servlets and JSP.

Business logic objects are Business logic objects are implemented as EJB and/or servlets.implemented as EJB and/or servlets.

Data layer represented with EJB.Data layer represented with EJB.

J2EE ContainersJ2EE Containers

J2EE containers provide:J2EE containers provide:• An environment and context for J2EE An environment and context for J2EE

components to execute.components to execute.• Resource management and other system Resource management and other system

services to the components.services to the components. Operating system processes.Operating system processes. Threads.Threads.

Container services are exposed to Container services are exposed to components through interfaces (the components through interfaces (the container itself is specified using container itself is specified using interfaces).interfaces).

J2EE ConnectorsJ2EE Connectors

Connectors are used to integrate various existing Connectors are used to integrate various existing information systems in a J2EE-based application.information systems in a J2EE-based application.

J2EE ConnectorsJ2EE Connectors

Leverage investments in existing Leverage investments in existing enterprise systems.enterprise systems.

A connector is a vendor-specific bridge A connector is a vendor-specific bridge used to link an existing system to the used to link an existing system to the J2EE system.J2EE system.

Connectors manage (and hide) all the Connectors manage (and hide) all the logic used to integrate with logic used to integrate with proprietary systems and present their proprietary systems and present their services as JavaBeans components.services as JavaBeans components.

J2EE ApplicationsJ2EE Applications

A J2EE application is a collection of software A J2EE application is a collection of software components that are engineered to be components that are engineered to be distributed across multiple tires of an N-tier distributed across multiple tires of an N-tier system. These software components are system. These software components are implemented as EJB.implemented as EJB.

J2EE applications may play the role of a client or J2EE applications may play the role of a client or a server depending on which tier they are a server depending on which tier they are deployed.deployed.

J2EE applications are not required to be J2EE applications are not required to be distributed, but they should be engineered so distributed, but they should be engineered so that they may be deployed on a distributed that they may be deployed on a distributed system.system.

J2EE Application ComponentsJ2EE Application Components

There are two types of J2EE application There are two types of J2EE application components: Web components for handling components: Web components for handling presentation logic and EJB components for presentation logic and EJB components for handling the business logic.handling the business logic.• Web components are implemented as JSP or Web components are implemented as JSP or

servlets. These components shield the first-tier servlets. These components shield the first-tier clients from the complexity of the application clients from the complexity of the application server.server.

• JSP presents application server services in a JSP presents application server services in a form that is usable by any browser-based client.form that is usable by any browser-based client.

• Servlets manage the presentation of application Servlets manage the presentation of application server services for clients such as Java server services for clients such as Java appplets, Java applications and Web browsers.appplets, Java applications and Web browsers.