Home > Design Patterns > File Gateway
File Gateway

File Gateway (Roy)

How can service logic interact with legacy systems that can only share information by exchanging files?

Problem

Data records contained in flat files produced by a legacy system need to be processed individually by service logic, but legacy systems are not capable of directly invoking services. Conversely, service logic may need to produce information for the legacy system, but building file creation and transfer functionality into the service can result in an inflexible design.

Solution

Intermediary two-way file processing logic is positioned between the legacy system and the service.

Application

For inbound data the file gateway processing logic can detect file drops and leverage available broker features to perform Data Model Transformation and Data Format Transformation. On the outbound side, this logic intercepts information produced by services and packages them (with possible transformation) into new or existing files for consumption by the legacy system.

Impacts

The type of logic provided by this pattern is unsuitable when immediate replies are required by either service or legacy system. Deployment and governance of two-way file processing logic can further add to operational complexity and may require specialized administration skills.

Architecture

Service
File Gateway: File gateway logic acts as a mediator between a service and a flat-file-based legacy system.

File gateway logic acts as a mediator between a service and a flat-file-based legacy system.