Best Practices for WLI Application Lifecycle

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Core Implementation Patterns for WLI Applications

There are several core implementation patterns for WLI applications, as explained in the following sections:

Core Implementation Patterns for a JPD

JPDs are of several types and are designed with the following intrinsic characteristics:

Note: Composite processes have more complex exception management because of the multiple calls.

Several patterns of JPDs have resulted from combinations of these characteristics. The following sections describe these patterns in brief:

Pattern 1: Basic Synchronous Stateless two-way Service

Use this pattern illustrated in Figure 6-1 to implement some of the fastest processes. The standard usage is for simple access to a backend system or to implement helper processes.

Figure 6-1 Pattern 1

Pattern 1

Pattern 2: Basic Asynchronous Stateless two-way Service

Use this pattern illustrated in Figure 6-2 to implement some of the fastest processes. The standard usage is for simple access to a backend system, when de-coupling with the process client is required.

Figure 6-2 Pattern 2

Pattern 2

Pattern 3: Basic Asynchronous Stateless one-way Service

Use this pattern illustrated in Figure 6-3 to implement some of the fastest processes. The standard usage is to access backend systems in event-driven situations.

Figure 6-3 Pattern 3

Pattern 3

Pattern 4: Basic Asynchronous Stateful two-way Service

This pattern is not as fast as its stateless equivalent. Use this pattern illustrated in Figure 6-4 to access backend systems that provide an asynchronous interface.

Figure 6-4 Pattern 4

Pattern 4

Pattern 5: Basic Asynchronous Stateful one-way Service

This pattern is very rare because most of the one-way services are stateless and so there is no need to wait for an answer. Use this pattern illustrated in Figure 6-5 to quickly access a backend system in event-driven situation where a call that is waiting is required.

Figure 6-5 Pattern 5

Pattern 5

Pattern 6: Composite Synchronous Stateless two-way Service

Use this pattern illustrated in Figure 6-6 to implement integration logic that requires good performance and coupling with the client.

Figure 6-6 Pattern 6

Pattern 6

Pattern 7: Composite Synchronous Stateful two-way Service

This pattern represents an unusual case, where the logic is implemented after the client has received a response. Use this pattern illustrated in Figure 6-7 to enable a stateful process that runs for a period of time, and is started by a synchronous request or response. Once the synchronous reply is sent, the process moves to a traditional asynchronous model.

Figure 6-7 Pattern 7

Pattern 7

Pattern 8: Composite Asynchronous Stateless two-way Service

This pattern illustrated in Figure 6-8 is a standard method to implement integration logic that requires good performance while maintaining de-coupling from its client. It can also be used to access a backend system when de-coupling from the caller is required. It is not always possible to implement this pattern as it requires all the resources used to be stateless.

Figure 6-8 Pattern 8

Pattern 8

Pattern 9: Composite Asynchronous Stateless one-way Service

Use this pattern illustrated in Figure 6-9 to implement integration logic that requires good performance in event-driven situations.

Figure 6-9 Pattern 9

Pattern 9

Pattern 10: Composite Asynchronous Stateful two-way Service

Use this pattern illustrated in Figure 6-10 when the stateless version of the same pattern is not possible, as at least one of the resources contains an asynchronous interface. It is also used as a standard pattern for long-running processes.

Figure 6-10 Pattern 10

Pattern 10

Pattern 11: Composite Asynchronous Stateful one-way Service

This pattern is not common as most of the one-way services are usually stateless and there is no need to wait for an answer. Use this pattern illustrated in Figure 6-11 to implement integration logic in event-driven scenarios, and where a call that is waiting is also required.

Figure 6-11 Pattern 11

Pattern 11

Other Patterns

This section re-groups useful patterns, which can be used in combination with one of the core patterns.

SyncAsync Pattern

You can create a business process containing a client request node with a sync or async callback name attribute property, to enable synchronous clients to interact with business processes that have asynchronous interactions with resources. The client request node property holds the name of the callback method that the associated client response node uses. The client request and client response nodes delineate the activities (including asynchronous activities) that occur while the client is blocking the process. After setting this property, generate the sync-to-async WSDL. The synchronous WSDL generation process replaces the SOAP address of the service with a modified SOAP address. The modified address causes the synchronous servlet to process the client request and subsequent return action. A sample of the generated service entry is as follows:

Normal WSDL

<service name="syncAsync">
<port name="syncAsyncSoap" binding="s0: syncAsyncSoap">
<soap: address 
location="http://localhost:7001/SyncAsyncWeb/processes/syncAsync.jpd"/>
</port> 

Synchronous WSDL

<service name="syncAsync">
<port name="syncAsyncSoap" binding="s0: syncAsyncSoap">
<soap:address 
location="http://localhost:7001/sync2AsyncIM/SyncAsyncWeb/processes/syncAsync.sync2JPD"/>
De-Synchronizer Pattern

The de-synchronizer pattern allows you to asynchronously call a synchronous process. This is recommended if:

Implement the process in Figure 6-12 to provide an asynchronous interface to a synchronous process.

Figure 6-12 De-Synchronizer Pattern

De-Synchronizer Pattern

De-Synchronizer Service

This is a simple proxy process. The signature of the request and the response should remain the same as that of the original service. The de-synchronizer passes its input values to the sub-process and sends the return value to the caller of the sub-process.

Course-Grained Process Front-end for a Fine-Grained Process

Figure 6-13 illustrates an example of how you can use a combination of course-grained and fine grained processes. A course-grained process assigns specific work to a number of fine-grained processes.

Figure 6-13 Front-end a Fine-Grained Process With a Course-Grained Process

Front-end a Fine-Grained Process With a Course-Grained Process

Loosely Coupled Process With a Common Message Interface

This pattern illustrated in Figure 6-14 shows how you can create a loosely coupled process using a common messaging interface through message brokers, based upon a Publish and Subscribe architecture.

Figure 6-14 Loosely Coupled Process Using Message Interface

Loosely Coupled Process Using Message Interface

Dynamic Property Driven Processes

You can use the following controls to define a dynamic, property driven process:

Figure 6-15 illustrates an example of an agile and dynamic process with a Register and Table look-up.

Figure 6-15 Agile, Dynamic Process with a Register and Table Look-up

Agile, Dynamic Process with a Register and Table Look-up

The features of this process are as follows:


  Back to Top       Previous  Next