Microsoft PPT 97
Download
Report
Transcript Microsoft PPT 97
Java Beans and
Enterprise Java Beans
CSE298
CSE300
CSE333
Paul C. Barr
The Mitre Corporation
Eatontown NJ
Kimble Cheron and
Prof. Steven A. Demurjian
Computer Science & Engr. Dept.
[email protected]
[email protected]
http://www.engr.uconn.edu/~steve
(860) 486 - 4818
EJB-1.1
Changing Perspectives
CSE298
CSE300
CSE333
Computers are Guilty of Creating More Disorder
then Simplicity
Current Software Systems are Relics
Built Largely By and For Technical Computer
Users
Never Intended to Operate in Today’s
Environment
Designer’s Need to Break Out of Old Mold
Consider Total Design Space
Design Should Help Manage Complexity, Not
Add to It
What is Available to Assist in Changing Times?
EJB-1.2
Components
CSE298
CSE300
CSE333
Reusable Software Building Blocks
Pre-Constructed from Encapsulated Application
Code
Easily Combined with Other Components
Seamlessly Merged with Custom Code
Rapid Prototyping of Complete Applicaiton
What is a Component?
GUI Widget (Button, Window, etc.)
Combination of Components (Window with
Elevator Bars and Pull-Down Menus)
Application Service (Account Management
Function)
EJB-1.3
Overview
CSE298
CSE300
CSE333
A First Look at Java Beans
What are They and How are They Utilized?
Enterprise Java Beans
Not Just for Clients Anymore!
Capabilities and Usage
Relationship to “New” and “Old” Technologies
Component-Based Client/Server Model
Multi-Tiered Architecture and EJB
Tiered Development for Extensibility
Comparisons of Approaches
Java Blend for Database Interoperability
Overall Concluding Remarks
EJB-1.4
Java Beans
CSE298
CSE300
CSE333
Extends "Write Once, Run Anywhere (WORA)TM"
to Include "Reuse Everywhere”
What is a Bean?
Independent Reusable Software Component
Visually Manipulated in Builder Tools
Can Be Visible Object:
AWT Components
or Invisible Objects:
Queues and Stacks
or Composed Objects:
Calculator Ops + Keys + Display
EJB-1.5
Java Beans
CSE298
CSE300
CSE333
Bean vs. Component
Source Code Inaccessible
Customizable to Suit Application Needs via
External Properties
Powerful Means of Reuse
Examples
GUI Button with Property to Allow Button
Name to be Set
Account Management Component that Allows
Account Database Location to be Set
Properties Can be Very Complex and Offer
Significant Power to Application Builders
EJB-1.6
What are Enterprise Java Beans ?
CSE298
CSE300
CSE333
Expansion of Java Beans (Client-side) to Support
Server Side Reusable Components
Server Components Run on Application Server
EJB Integral Part of Java Technology
Component Architecture for Distributed Systems
Multi-Tier Distributed Architecture
Movement of Application Logic from Client to
Server Side
Creation of “Thin”, Easier to Maintain Clients
Framework for Creating Middle Ware
Integration of “New” and “Old” Technologies
RMI, IIOP, CORBA, RPC, Active X, etc.
EJB-1.7
Designer and Developer Roles in
Enterprise Java Beans (EJB)
CSE298
CSE300
CSE333
Towards “Highly Scalable, Highly Available,
Highly Reliable, Highly Secure, Transaction
Distributed Applications”
Enterprise Bean Provider
Creates and Sells EJBs
Application Assembler
Uses EJBs to Build an Application
EJB Server Provider
Creates and Sells EJB Server
EJB Container Provider
Creates and Sells EJB Containers
Server Provider Will Likely Provide Containers
EJB-1.8
EJB Roles & Deployment
CSE298
CSE300
CSE333
EJB-1.9
Utilizing EJB Technology
CSE298
CSE300
CSE333
EJB-1.10
The EJB Architecture
CSE298
CSE300
CSE333
EJB Servers: Analogous to CORBA ORB
Server Software
Provides Naming and Transaction Services
Makes Containers Visible
EJB Containers: Interface Between EJB Bean and
Outside World
Client Never Accesses Bean Directly
Access via Container-Generated Methods
These Methods Then Call the Bean’s Methods
EJB Clients
Locate EJB Containers Via JNDI
Make Use of EJB Beans
Enterprise Java Beans - Discussed Shortly
EJB-1.11
EJB Container
CSE298
CSE300
CSE333
EJB-1.12
Enterprise Java APIs
CSE298
CSE300
CSE333
EJB-1.13
Enterprise Java Beans
Session Beans
CSE298
CSE300
CSE333
Associated With a Particular Client
Performs Operations on Behalf of Client
Accessing a Database
Performing Calculations
Created and Destroyed by a Client
Can be Transactional - But, Do Not Survive
System Shutdown
Can be Stateless or Maintain Conventional State
Across Methods and Transactions
Must Manage Own Persistent Data
EJB-1.14
Enterprise Java Beans
Entity Beans
CSE298
CSE300
CSE333
Object Representation of Persistent Data
Maintained in Permanent Store (Database
Identifiable by Primary Key
Shared by Multiple Clients
Persist Across Multiple Invocations
Survive System Shutdown
Created by
Inserting Data into Database
Creating an Object Instance
EJB-1.15
Model for Persistence
Passivation/Activation
CSE298
CSE300
CSE333
Programmatic Model for Managing Persistent
Objects
EJB Server has the Right to Manage its Working
Set
Passivation
Saves State of a Bean to Persistent Storage
Then Swaps Bean Out
Activation
Restores State of a Bean From Persistent
Storage,Then Swaps Bean in
Applies to Both Session and Entity Beans
EJB-1.16
Stateless vs. Stateful Session Beans
CSE298
CSE300
CSE333
Stateless
No Internal State
Do Not Need to Be "Pass-ivated"
Can Be Pooled to Service Multiple Clients
Stateful
Possess Internal State
Need to Handle Passivation/Activation
One Per Client
EJB-1.17
Entity Bean Persistence
CSE298
CSE300
CSE333
Container-Managed
Container is Responsible for Saving State
In Deployment Descriptor, Specify ContainerManaged Fields
Persistence Independent of Data Source
Bean-Managed
Bean is Responsible for Saving its Own State
Container Doesn’t Need to Generate DB Calls
Less Adaptable; Persistence is Hard-Coded
EJB-1.18
Deploying EJBs
CSE298
CSE300
CSE333
EJBs Deployed As .SER Files: Serialized Instance
Manifest File Used to List EJBs
Must Also Provide a “Deployment Descriptor”
Sample Entry
Name: paul.RestaurantDeployment.ser
Enterprise-Bean: True
“Name” Line
Describes a Serialized Deployment Descriptor
“Enterprise-Bean” Line
Indicates Whether the Entry Should Be Treated
as an EJB
(Not All Entries Need to Be EJBs)
EJB-1.19
Who’s Announced EJB Support?
CSE298
CSE300
CSE333
WebLogic
IBM
Oracle
GemStone
BEA
Borland
Netscape
Lotus
Forte
Progress
Novell
Novera
Borland
Informix
IONA
More...
EJB-1.20
Typical Development and Deployment
Scenario
CSE298
CSE300
CSE333
EJB Server Provider
Creates and Sells an EJB Server
Provides EJB Containers That Will Run on
These Servers
EJB Providers
Individuals Responsible for Developing the
EJBs
Provide “Tools” and “Components” for DownStream Usage
Application Assemblers
Individuals that Utilize Pre-Built EJBs to
Construct Their Domain-Specific Applications
Utilize “State-of-Art-Tools” for EJB and JB
EJB-1.21
EJB Component-Based Architecture
CSE298
CSE300
CSE333
EJB Server
EJB Client
Invoke EJB
Container
Methods
Enterprise
Java Bean
Invoke
EJB
Methods
EJB Container
EJB-1.22
Client-Server Component Model
CSE298
CSE300
CSE333
EJB-1.23
Two-Tier, Three-Tier, Four-Tier
Example Architectures
CSE298
CSE300
CSE333
From: http://java.sun.com/javaone/javaone98/sessions/T400/index.html
EJB-1.24
Wombat Securities
CSE298
CSE300
CSE333
Web Access to Brokerage Accounts
Only HTML Browser Required on Front End
"Brokerbean" EJB Provides Business Logic
Login, Query, Trade Servlets Call Brokerbean
Use JNDI to Find EJBs, RMI to Invoke Them
Order and History Records from Java Blend
Product
Records Mapped to Oracle Tables, JDBC Calls
EJB-1.25
Four-Tier Architecture Example
CSE298
CSE300
CSE333
EJB-1.26
Nocturnal Aviation, Inc.
CSE298
CSE300
CSE333
Passenger Check-in for Regional Airline
Local Database for Seating on Today's Flights
Clients Invoke EJBs at Local Site Through RMI
EJBs Update Database and Queue Updates
JMS Queues Updates to Legacy System
DBC API Used to Access Local Database
JTS Synchs Remote Queue With Local Updates
EJB-1.27
Three-Tier Example
CSE298
CSE300
CSE333
EJB-1.28
Santa Cruz Widgets
CSE298
CSE300
CSE333
Small Manufacturer Previously on C++
New Order Entry, Inventory, and Invoicing
Applications in Java Programming Language
Existing Customer and Order Database
Most of Business Logic in Stored Procedures
Tool-generated GUI Forms for Java Objects
Located Company on Web Using Widgets and Tcl,
but Not Widgets and Java
EJB-1.29
Santa Cruz Widgets (2-tier)
CSE298
CSE300
CSE333
EJB-1.30
Architecture Comparisons
CSE298
CSE300
CSE333
Two-tier Through JDBC API: Simplest
Multi-tier: Separate Business Logic, Protect
Database Integrity, More Scaleable
JMS Queues Vs Synchronous (RMI or IDL):
Availability, Response Time, Decoupling
JMS Publish & Subscribe: Off-line Notification
RMI IIOP Vs JRMP Vs Java IDL:
Standard Cross-language Calls or Full Java
Functionality
JTS: Distributed Integrity, Lockstep Actions
EJB-1.31
Further API Comparisons
CSE298
CSE300
CSE333
Servlets: Simplifies HTML, Connections, Web
Front-Ending Legacy Systems
EJBs: Simplifies Components, Scalability,
Transactions, Multi-threading, Security, State
JDBC Vs ODMG Vs SQLJ API:
Programming Simplicity, Portability, SQL
Knowledge
JNDI: Standardized Name Service Access
Enterprise Java APIs vs. Proprietary:
Multi-Platform, Multiple Providers
EJB-1.32
Summary & Key Messages
CSE298
CSE300
CSE333
Enterprise Java APIs: EJB, JNDI, Java IDL, RMI,
JDBC, ODMG, SQLJ, JMS, JTS, JMAPI, Servlets
Wide Variety of Architectural Alternatives:
Synchronous/Asynchronous, Multi-Tier,
Transactional, HTTP/JRMP/IIOP
Benefits:
WORA Portability
Multiple Vendors
Legacy Connectivity
Java Programming Language Productivity
EJB-1.33
EJB Roadmap
CSE298
CSE300
API
EJB
CSE333 JNDI
JIDL
RMI
JDBC
ODMG
SQLJ
JMS
JTS
JMAPI
Sevlets
Specification
Complete
Products
JavaSoft
JavaSoft
OMG
JavaSoft
JavaSoft
Consortium
Consortium
JavaSoft
OMG
JavaSoft
JavaSoft
1.0Q1
1.0 done
1.0 Q2
1.0 done
2.0 Q2
2.0 done
1.0 Q2
1.0 Q2
1.0 done
1.0 Q2
1.1 done
See Partners
Download SP
JDK 1.2
JDK 1.1
JDK 1.2 Partner
JavaBlend
See Partners
See Partners
Partners
See Partners
Java Web Server
EJB-1.34
What Is the Java Blend Product?
CSE298
CSE300
CSE333
Product That Integrates Java Programming
Language Objects With Enterprise Data
Provides a Single Object Model Based on Java
Programming Language Classes
Automatic Persistent Storage for Java
Application Objects
Easy, Automatic Access to Existing Relational
Databases From Java Applications
Result of Joint Development by the Javasoft
Division, Baan and Tech@spree
EJB-1.35
JavaBlend Applications
CSE298
CSE300
CSE333
JavaBlend Software Provides Mapping Capability
Between Database Tables and Java Application
Classes
Programmer Deals Only With Java Programming
Language Objects, and Does Not Need to Know
SQL or Database Representation
EJB-1.36
Java Blend Components
CSE298
CSE300
CSE333
Flexible Development Tool for Automatic
Bi-Directional Mapping
Objects to Relational
Relational to Objects
Powerful Runtime Environment
Transaction Management System
Query Processor
Cache Management System
EJB-1.37
Java Blend Runtime Architecture
CSE298
CSE300
CSE333
EJB-1.38
Java Blend Software and Enterprise
JavaBeans Technology
CSE298
CSE300
CSE333
EJB Technology Provides Scaleable Component
Architecture for Business Applications
Java Blend Product Provides Transparent
Persistence for Enterprise Javabeans Technology
Beans Implementing Business Logic Use Java
Blend for Database Access
Java Blend Product Works With the Enterprise
Javabeans API Transaction Mechanisms
EJB-1.39
Concluding Remarks
Enterprise Computing/Interoperability
CSE298
CSE300
CSE333
Technologies Continue to Emerge and Mature
Complex Problem for Companies and
Organizations
What are “Good” and “Stable” Technologies?
How can they be Leveraged for Gain?
Which Technologies Will Emerge in ShortTerm and Long-Term?
How will Technologies Interact?
CORBA vs. DCOM vs. EJB
Java vs. Component Design/Programming
Heterogeneous Agent Platforms
Future Difficult to Predict!
EJB-1.40