← All notes

Aug 2026 · 6 min read

Zero-code integrations with the Factory and Strategy patterns

Every new third-party integration used to mean new mapping code. A metadata-driven engine turned it into configuration and saved about 40 hours a month.

Design patternsLLDJava

An integration platform talks to many external APIs. Each one wants requests in its own shape and answers in its own shape. When every integration has hand-written mapping code, adding one takes days and every change risks breaking another.

Separate what changes from what doesn't

The flow is always the same: build a request, call the API, map the response. Only the mapping differs. That is exactly what the Strategy pattern is for.

java
public interface MappingStrategy {
    ExternalRequest toRequest(Order order, MappingConfig config);
    Result fromResponse(ExternalResponse response, MappingConfig config);
}

Let metadata choose the strategy

A Factory reads the integration's metadata (format, field mappings, auth type) and returns the right strategy. Most integrations share a generic, configuration-driven strategy, and only unusual ones need a custom class.

java
public class MappingStrategyFactory {
    private final Map<String, MappingStrategy> custom;
    private final MappingStrategy generic;

    public MappingStrategy forIntegration(MappingConfig config) {
        return custom.getOrDefault(config.integrationId(), generic);
    }
}

SOLID in practice

  • Open/closed: new integrations add configuration, not edits to existing code
  • Single responsibility: calling an API and mapping its data are separate concerns
  • Dependency inversion: the workflow depends on MappingStrategy, not on concrete integrations

Result

Onboarding a standard integration became a configuration task. That removed about 40 hours a month of manual configuration work, and it later made it possible to have AI agents generate the configuration from API specs.