Quant with Vahab
Quant Systems Lab · Control Systems for Quantitative Finance

Product and Pricer Registry

Use registries to map product types and models to pricers instead of hard-wiring dependencies.

Explanation

A product registry maps product_type identifiers from booking to concrete instrument classes.

A pricer registry maps (product_type, model_type, purpose) pairs to concrete pricer implementations.

Registries allow new products and methods to be added without modifying existing pricing code paths.

This pattern enforces dependency inversion: high-level modules depend on interfaces, not on concrete classes.


architectureregistryextensibilitydependency inversion
Interactive visualisation

This diagram compares a hard-wired product–pricer mapping with a registry-based design. Use the controls to change how many product types, models, and purposes you support and see how registries cut down direct dependencies.

Direct dependencies: 8
product types (booking)registriespricers (model × purpose)P1P2P3P4M1 · PxM2 · RiskM1 · PxM2 · Riskproduct registrypricer registrylook-ups via registrieshard-wired references
Numbers
Products: 4 · model types: 2 · purposes: 2 → pricers: 4
Direct edges with registries ≈ 8
Direct edges when hard-wired ≈ 16
Edges saved by registries ≈ 8
Interpretation

Without registries, every new product must know about every pricer implementation. Coupling grows as products × models × purposes, and small changes propagate across the codebase.

With registries, booking talks to a product registry and risk systems talk to a pricer registry. New products and models are added by registering them rather than editing core pricing logic. The practitioner’s rule: registries turn “add one product, edit ten modules” into “add one product, register it once”.