|
|
| Sun ONE Connector Builder 2.0 Installation and Getting Started Guide |
Introduction to Sun ONE Connector Builder SamplesThe following topics are described in this module.
- Styles of EIS Application Programming Interfaces
- General Approach to Building Adapters with Connector Builder
- Samples
Styles of EIS Application Programming Interfaces
EIS APIs follow one of two styles: specific or general-purpose. To create a resource adapter you need to understand what type of EIS API you are working with so that you can correctly generate a resource adapter and implement the appropriate customizations.
Specific EIS APIs
Often, a package or legacy system has an API that contains methods that trigger specific business tasks carried out inside the EIS. Many of the methods in this type of EIS API have names that reflect steps in a business process and use parameters that correspond closely with concepts from the business.
For example, the COTS sample EIS API that comes with Connector Builder is a specific EIS API. The COTS sample API includes individual methods such as getCustomer and updateOrder, both very closely related to specific business-oriented tasks inside the EIS. The parameters for these methods relate directly to business entities, such as a customer and a customer identifier or an order and its order status.
Even in specific EIS APIs some methods are concerned with the software itself: managing connections and security or controlling transactions. But the business work inside the EIS is triggered through methods that have business-oriented names and parameters.
General-purpose EIS APIs
Some packages use APIs that are less tightly coupled to the business functions that are carried out inside the EIS. These EIS APIs often include methods that refer more to software execution and control than to the business work they accomplish.
The DBMS sample resource adapter uses such a general-purpose API: the JDBC interface. This EIS API refers directly to database statements, result sets, tables, and so forth. The API itself does not refer to business concepts such as customers, orders, and payments. Instead, the business work inside the EIS is triggered through methods with software-oriented names and parameters.
Often, general-purpose EIS APIs have "execute" or "perform" methods. One of the parameters to such methods can be the name of a procedure, function, or task to be run in the EIS. In EIS APIs of this style, the business work inside the EIS is triggered through methods that have software-oriented names and parameters.
General Approach to Building Adapters with Connector Builder
There are disparate types of EIS APIs. Some APIs need a connection object or a handle to execute a backend call or business function, and some APIs execute on the connection itself.
Where the EIS API has a separate connection object, the following advantages are provided when generating a resource adapter using the Connector Builder:
- When the EIS API clearly expects a Connection, the Connector Builder generates the infrastructure related to the proper management of Connection Objects in the generated ManagedConnection and Connection code.
- Generated naming pattern and generated classes that are easily identifiable.
- Ease of use and code maintenance
- Most of the resource adapter code is generated and a minimum amount of customizations is required.
Because of these advantages, even if you have an API that executes on the connection itself, it is advantageous to wrap the EISAPI so that it appears to be separate from the connection object. For more information refer to Chapter 2 of the Connector Builder Developer's Guide.
Samples
The Connector Builder includes two comprehensive samples that illustrate key features:
- Customer Order Tracking System (COTS) sample includes a stubbed EIS, a resource adapter, and a web application.
- DBMS sample includes a resource adapter based on J2EE RI sample cciblackbox adapter and test programs.
These samples can be used as a reference to build resource adapters specific to your EIS.
Customer Order Tracking System (COTS) Sample
The Customer Order Tracking System is a sample EIS system supplied with the Sun ONE Connector Builder product. It demonstrates the capabilities of the Connector Builder for developing resource adapters for a specific API, for example, updateCustomer, createOrder.
The COTS sample includes the COTS Server, COTS Client API and COTS resource adapter built on the client API and a J2EE application that uses the resource adapter. The sample is provided with full source code and documentation to illustrate the design and implementation approach of the resource adapter. The COTS Client API demonstrates how an in house legacy application is exposed for external application interaction and integration.
The COTS resource adapter demonstrates how to utilize the Connector Builder as a comprehensive tool and framework to generate J2EE Connector Architecture 1.0 specification compliant resource adapters and expose EIS functions as SOAP services.
The COTS system manages customers, orders and products. The design and implementation of the COTS system is kept simple to provide easy to understand steps to build connectors. The real, working resource adapter exemplifies the Connector Builder guidelines, accelerates the facility of use and enables you to adapt the approach for building a resource adapter to suit your legacy application.
Data Base Management System (DBMS)
The DBMS resource adapter is supplied with the Sun ONE Connector Builder product. It demonstrates the capabilities of the Connector Builder, for developing a resource adapter for a generic API - in this example, for executing stored procedures in the database.
The DBMS sample includes the resource adapter built on the JDBC API and various tests to exercise the J2EE Connector Architecture 1.0 specification contracts. The sample is provided with source code and documentation to illustrate the design and implementation approach of the resource adapter. The DBMS resource adapter demonstrates how to sophisticatedly use the Connector Builder as a comprehensive tool and framework to generate J2EE Connector Architecture 1.0 specification compliant resource adapters. The sample also demonstrates, various advanced customizations users are required to perform, highlighting the sophisticated use cases that the Connector Builder addresses.
The DBMS resource adapter provides a generic way to interact with stored procedures, an in parallel take advantage of the J2EE Connector Architecture 1.0 specification. The design and implementation of DBMS resource adapter provide sophisticated complex, but easy to understand steps to build connectors on general purpose API, using Sun ONE Connector Builder.
The real, working resource adapter exemplifies the Connector Builder guidelines, accelerates the facility of use and enables you to adapt the approach for building a resource adapter for your off the shelf EIS/ERP systems.