↑ ↓ move · Enter open · Esc close

← All projects

MIDDLEWARE

CBS Middleware v2

Mutual Trust Bank PLC · 05/2026 - Present

A resilient middleware layer between digital channels and two core banking back-ends.

  • .NET 10
  • MediatR
  • FluentValidation
  • Dapper
  • Oracle
  • Polly
  • Quartz
  • JWT
  • xUnit
  • NetArchTest
Internet bankingMobileAgentsPaymentsDomainno dependencieson other layersAPI layercontrollers · rate limitsPipeline behavioursvalidation · idempotency · loggingHandlersCQRS commands and queriesAnti-corruption layerone gateway per back-endCore SOAPCore RESTPersistenceDapper · PollyOracle
  1. Channel
  2. Controller
  3. Pipeline behaviours
  4. Handler
  5. Anti-corruption layer
  6. Core back-end

The problem

// Context

Channels such as internet banking, mobile, agents and payment networks all needed a single, consistent way to reach the core banking systems. The legacy middleware was a monolith with logic tangled into transport code, which made every change risky.

Approach

// What I built
  • Clean Architecture with five projects: API, Application (CQRS with MediatR), Domain, Infrastructure and Persistence.
  • An anti-corruption layer wraps each back-end. SOAP gateways share a template-method base class and declarative response mapping, so no vendor type leaks above Infrastructure.
  • Pipeline behaviours handle logging, validation, idempotency, deadlines and performance in one place.
  • Oracle access goes through a package executor decorated with a Polly circuit breaker.
  • Architecture tests enforce the rules: layering, the ACL boundary, no raw SQL outside Persistence, and a validator for every mutating command.

Decisions and trade-offs

// Why it is built this way

Wire-format attributes live in Domain

Application DTOs can be annotated without referencing Infrastructure, and an architecture test keeps it that way.

One package executor for Oracle

Every database call passes through a single decorated executor, so circuit breaking and request auditing sit in one place.

Copy unverifiable constants verbatim

Product and segment codes that cannot be verified independently were kept exactly as in the legacy code and isolated in one handler.

Outcomes

// Result
  • All 34 legacy SOAP operations ported with the same business logic and cleaner plumbing.
  • 565 automated tests passing, including architecture tests.
  • Fixed a legacy correctness bug found during migration, where a tracking write and an approval chain ran unconditionally.
An unhandled error has occurred. Reload 🗙