Constat 2001
Download
Report
Transcript Constat 2001
Proof of Concept (POC) Proposal
3-Tier PFC extensions (3TX) using Java EJBs
presented by Garfield Allen
3TX
Proof of Concept (POC) Proposal
3-Tier PFC extensions (3TX) using Java EJBs
Contents:
Part 1: DESCRIPTION: What is 3 Tier ?
Part 2: Motives for 3-Tier Migration
Part 3: 3-Tier PowerBuilder
3TX
Proof of Concept Proposal
Proposal
Proof of which concept?
The concept to be proven is that 3-Tier PowerBuilder using the PFC and Java EJB technology
provides a highly effective and relatively simple way to solve the following problems:
Poor client-server application security.
Poorly coded business rules in DB Stored Procedures.
Single application with multiple front ends.
Inaccessible (or poorly accessible) enterprise data.
Page 3
3TX
Proof of Concept (POC) Proposal
3-Tier PFC extensions (3TX) using Java EJBs
Part 1: DESCRIPTION: What is 3 Tier ?
3TX
Proof of Concept Proposal
Description
What is 3-Tier Architecture?
3-tier architecture implies a system that is “distributed” across client application, database server
and a “middle tier” application server.
Middle Tier
Traditional Client-server architecture involves 2 tiers (client and server)
3-tier architecture introduces a middle tier (an application server such as Weblogic or EAServer) for hosting a portion
of the application’s functionality.
Partitioning: Full
True 3-tier architecture involves application partitioning.
Display logic (screens) is separated from business logic (code for non-visual features).
Partitioning: Partial
Partial 3-tier architecture means only the Database Access logic is implemented and deployed to the middle-tier
server.
Business logic remains where it is (in the client or in the database).
Page 5
3TX
Proof of Concept Proposal
What is 3-Tier Architecture?
Description: 2-Tier Architecture (Client-Server)
DB
GUI
PB Client Business
Logic
2-tier
Data
Access
Page 6
3TX
Proof of Concept Proposal
What is 3-Tier Architecture?
Description: 3-Tier Architecture
Middle Tier:
Application Server
Business
Logic
Data
Access
Any Database
Server
DB
PB Client GUI
Page 7
3TX
Proof of Concept (POC) Proposal
3-Tier PFC extensions (3TX) using Java EJBs
Part 2: Motives for 3-Tier Migration
3TX
Proof of Concept Proposal
Motives for 3-tier migration ?
3-TIER MIGRATION
There is a growing desire to migrate 2-tier (PowerBuilder) systems to 3-tier technology. This is for the
following reasons:
Security
Business Rules
Multiple Front Ends
Enterprise Data
Page 9
3TX
Proof of Concept Proposal
Motives for 3-tier migration ?
3-TIER MIGRATION
Security
A single generic login id is considered more secure than having large numbers of direct
database connections and user-specific userids.
The client application NEVER connects directly to the database (this is the principle of the
database De-Militarized Zone - the DMZ).
Page 10
3TX
Proof of Concept Proposal
Motives for 3-tier migration
3-TIER MIGRATION
Business Rules
Currently, all business rules for PowerBuilder applications reside either in the client application itself or
in the database (as Stored Procedures).
Client-side business logic is not recommended.
The Stored procedure programming language is considered insufficiently robust as a means of coding
complex business logic (there is no inheritance, no encapsulation, etc).
Java-based business logic is currently the recommended alternative. Hence the demand for a Java-based
application server upon which to deploy this Java-based business logic.
Page 11
3TX
Proof of Concept Proposal
Motives for 3-tier migration
3-TIER MIGRATION
Multiple Front Ends
Currently there are several business applications that have multiple front-ends, but a single database (for
example, the application is split between a PowerBuilder front-end AND a web front-end).
Each front-end uses its own duplicate of some or all of the application business rules.
Such applications would very much like to unify their code into one single enterprise-level layer that is
accessible from both front-ends. EJBs provide the means to do so.
The same enterprise-level Java POJOs could be accessed via Java Servlets for web apps, and via EJBs for
PowerBuilder apps).
Page 12
3TX
Proof of Concept Proposal
Motives for 3-tier migration
3-TIER MIGRATION
Enterprise Data
Enterprise data may exist in several different database systems – often from different database vendors
(eg: an Oracle DB, a Sybase DB, a mainframe DB).
An application may sometimes requires enterprise data from all of these systems.
3-Tier technology enables an application to easily use several different databases at once – even if the
DBMSs are from different vendors.
For the application, database access is generic – no vendor–specific code is required
Page 13
3TX
Proof of Concept Proposal
Motives for 3-tier migration
3-TIER MIGRATION
Additional motives for migrating to 3-tier technology:
Incorporation of new technology (Web Services, JAVA, HTML, .NET)
Reduced Database load through Database connection caching.
Higher performance, scalability, and High Availability through clustering.
Page 14
3TX
Proof of Concept (POC) Proposal
3-Tier PFC extensions (3TX) using Java EJBs
Part 3: 3TX – The 3-Tier PFC Extensions
3TX
Proof of Concept Proposal
How does it work within PowerBuilder ?
3TX – The 3-Tier PFC Extensions
3-Tier PowerBuilder
PowerBuilder is fully capable of creating 3-tier applications (since version 7).
PowerBuilder uses the Sybase application server (Sybase EASERVER).
However PowerBuilder can also use any generic JAVA-based (J2EE compliant) application server (e.g.
WebLogic, WebSphere, JBOSS).
Now, 3TX introduces new PFC objects to enable 2-tier PFC applications to become 3-tier
applications using EJBs.
Page 16
3TX
Proof of Concept Proposal
How does it work within PowerBuilder ?
3TX – The 3-Tier PFC Extensions
New PFC Client-Side Objects and Events
Three New PFC client-side objects have been created:
The Client Interface Manager (CIM) – Datawindow version
The Client Interface Manager (CIM) – Datastore version
EJBCA (the connection manager for EJB objects)
Three New PFC Datawindow/Datastore events have been created:
pfc_ejblookup
pfc_ejbretrieve
pfc_ejbupdate
Page 17
3TX
Proof of Concept Proposal
How does it work within PowerBuilder ?
3TX – The 3-Tier PFC Extensions
Client-Side Objects: Client Interface Manager (CIM)
Automatically manages all interaction between DataWindow/DataStore and EJB server.
Is automatically called from the DW/DS sqlpreview( ) event if CIM object is in memory.
Has its own retrieve and update functions.
Automatically calls ejbretrieve, ejblookup and ejbupdate events.
Page 18
3TX
Proof of Concept Proposal
How does it work within PowerBuilder ?
3TX – The 3-Tier PFC Extensions
Client-Side Objects: EJBCA
EJBCA is the run-time name for the new PFC object n_ejbconnection.
This is the connection manager for all EJB objects.
Represents the EJB server equivalent of SQLCA transaction object
It is derived from the ejbconnection object found in the pbejbclientXX.pbl.
Handles all EJB server connection duties.
Handles connect, disconnect and lookup.
Handles specialist database functions like begin trans, commit, rollback and sysdate.
Page 19
3TX
Proof of Concept Proposal
How does it work within PowerBuilder ?
3TX – The 3-Tier PFC Extensions
Client-Side Events: pfc_ejblookup
Represents the EJB equivalent of settransobject() function.
Here, the system is told which EJB object will be used with this DW/DS
Coded at the application level (not at the PFC level)
Each DW/DS can be coded individually, or in the ancestor.
Page 20
3TX
Proof of Concept Proposal
How does it work within PowerBuilder ?
3TX – The 3-Tier PFC Extensions
Client-Side Events: pfc_ejbretrieve
Represents the EJB equivalent pfc_retrieve() event.
Here, the system is told which EJB method is used to retrieve data into this DW/DS.
Coded at the application level (not at the PFC level).
Each DW/DS can be coded individually, or in the ancestor.
Page 21
3TX
Proof of Concept Proposal
How does it work within PowerBuilder ?
3TX – The 3-Tier PFC Extensions
Client-Side Events: pfc_ejbupdate
Represents the EJB equivalent of the update() DW/DS function.
Here, the system is told which EJB method is used to update the data to the database from this
DW/DS.
Coded at the application level (not at the PFC level).
Each DW/DS can be coded individually, or in the ancestor.
Page 22
3TX
Proof of Concept Proposal
How does it work within PowerBuilder ?
3TX – The 3-Tier PFC Extensions
Server-Side Objects and Methods
Three Java components have been created:
Data Access Object (DAO) – Stateless Session Bean
User Session Object (UsrSession) - Stateful Session Bean
Main object – Java POJO
Server-Side objects encompass five standard methods:
pfcRetrieve
pfcUpdate
pfcInitSession
pfcEndSession
pfcGetSysDate
Page 23
3TX
Proof of Concept Proposal
How does it work within PowerBuilder ?
3TX – The 3-Tier PFC Extensions
Server-Side Objects: Data Access Object (DAO)
Stateless Session Bean.
Handles JDBC drivers.
Connection cache management.
Open and close connection
Resultset processing
Stored procedure calls
Page 24
3TX
Proof of Concept Proposal
How does it work within PowerBuilder ?
3TX – The 3-Tier PFC Extensions
Server-Side Objects: User Session Object.
Stateful session bean.
Stores user specific data (information that is needed beyond each method call).
Stores the name of the DataBase cache that is assigned to this user (for systems with multiple Database
roles).
A serialized reference (Java Handle) to this object is stored in the client (PowerBuilder) application as a
global variable.
Page 25
3TX
Proof of Concept Proposal
How does it work within PowerBuilder ?
3TX – The 3-Tier PFC Extensions
Server-Side Objects: Main object
This is the REAL server-side object.
EJBs have no genuine user-defined methods.
User-defined methods of the EJB simply reference the same-name methods of the POJO.
In this manner, the implementation of business rules is confined to the POJO only.
No business rules are implemented in the EJB (therefore maintenance is simpler).
Page 26
3TX
Proof of Concept Proposal
How does it work within PowerBuilder ?
3TX – The 3-Tier PFC Extensions
Server-Side Methods: The Five General Methods
pfcRetrieve
For processing all retrieve statements and in-line SQL statements.
pfcUpdate
For processing all “UPDATE”, “DELETE” and “INSERT” statements.
pfcInitSession
Instantiation of the UsrSession stateful session bean.
The EJB’s java handle reference is given as the return value.
pfcEndSession
Destroys the UsrSession stateful session bean.
This command is issued just before the PowerBuilder application closes.
pfcGetSysDate
Returns the current system date of the database specified in the connection cache.
Page 27
3TX
Proof of Concept Proposal
How does it work within PowerBuilder ?
3TX – The 3-Tier PFC Extensions
3TX and the PFC Framework:
The client application (PowerBuilder) generates SQL to be sent to the database.
Each time the client application attempts to send a SQL statement to the database it is intercepted and
re-directed to the CIM.
The CIM (in conjunction with the EJBCA) handles all aspects of communication with the Java server:
Calling Java proxies
Formatting SQL
Processing return values
Resultsets
Page 28
3TX
Proof of Concept Proposal
How does it work within PowerBuilder ?
3-Tier PowerBuilder
3TX and the PFC Framework:
The CIM automatically populates the PowerBuilder DataWindow or DataStore.
The server-side Java EJBs together handle all aspects of database communication
For simplicity, all business methods are encapsulated in the server-side POJO. The EJBs do nothing but
call the POJO’s methods.
Page 29
3TX
Proof of Concept Proposal
How does it work within PowerBuilder ?
3TX – The 3-Tier PFC Extensions
DW1
DW2
DW3
Client
Workstation
sqlpreview
Application
Server
EJB Stateful Bean
(Session manager)
Connection Cache
CIM
Any Database
EJB Stateless
Bean (DAO)
DS1
sqlpreview
DS2
Page 30
3TX
Proof of Concept Proposal
3TX – v2.0 - What’s in the next version ?
3TX – Coming Soon v2.0
The Next Version of 3TX with the PFC Framework:
Page 31
Support for EAServer, JBoss and Websphere (currently only Weblogic is supported).
Server-Side PowerBuilder objects (NVOs deployed on the Java server using the PowerBuilder Application Server Plug-In – available with PB 11.5).
Full 3-Tier functionality (no SQL is exchanged between client and server – only arguments and parameters).
Support for EJB v3.0 (currently only EJB 2.1 is supported).
Support for .NET – a PowerBuilder NVO that is EJB enabled (that is, can communicate with a Java server using EJBs) will be deployed directly to the
Visual Studio.Net development environment to build hybrid PB/.NET applications (a pure .NET application is currently INCAPABLE of
communicating with Java EJBs).
3TX
Proof of Concept Proposal
For More Information: Contact Details
Contact Details:
For more information, please contact the following email address/phone number:
EMAIL:
[email protected]
Telephone:
+33 (0) 6 43 43 87 27
Page 32
3TX