As you learned in Chapter 2, "e-Business Concepts and Architecture," at times integrating two applications is not principally a matter of integrating data, but integrating business logic. The Brokering Application pattern addresses the use of intermediary application logic to link together two or more applications. In plain terms, it means that custom application code is written containing logic to broker interactions between the disparate applications. This custom brokering application sits in the middle as an intermediary for processing requests from different applications, as shown in Figure 3.4.
Figure 3.4 Brokering Application.
The use of this solution pattern is particularly applicable in the scenarios presented in the following sections.
Applications Need to Reuse Logic
The Brokering Application pattern may often be used effectively when two or more applications need to share or reuse common business logic. For instance, if application A contains business logic for a specific calculation and other applications can use such calculation logic, you can write intermediary custom code to access the logic from application A. In this case, the intermediary brokering application acts as a proxy to application A.
Applications Linked by Complex Logic
At times, the logic needed to bind applications together is not of the type that can be addressed even by the previously described multi-step MSAI pattern. As you learned in the previous section, MSAI can link applications by means of sequential logical processing, but it cannot provide a means for complex logic such as a routing algorithm for delivery trucks that might be utilized by applications in a trucking company. This scenario requires that the custom logic is available as a service that other applications can participate in or be directed by.
Applications Unified Through User Interface
Although most of the integration discussed here occurs through writing intermediate code for server-to-server integration, it is certainly not restricted to that scenario specifically. Figure 3.5 depicts how two or more applications can be integrated via a common user interface. This is essentially the use of a client-side brokering application. The user interface does not need to be a graphical user interface (GUI) although more often than not, it is.
Figure 3.5 User interfacedriven integration.
The use of this pattern is commonly applied in IT infrastructure as two-tiered client/server implementations. Implemented in this form, the unifying client-side application is a fat client accessing multiple databases or applications.
The Brokering Application pattern is used extensively even though it entails the writing of custom logic in part because there remains a class of problems that will only be solved by this pattern. This necessitates the use of technologies such as Application Servers, which will be described in greater detail in Chapter 5, "Application Servers."