Product and Pricer Registry

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

intermediatearchitectureregistryextensibilitydependency inversion

Mental model

A registry makes product-to-pricer selection explicit instead of scattering type decisions through the codebase.

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.

INTERACTIVE INTUITION

Explore the mechanism

How can the system select a valid pricer for a product and model without embedding type checks throughout the code?

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”.

UNDERSTAND

What to notice

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.

TRANSFER

Where it appears

  • dispatching trades to valuation engines
  • registering new products and models
  • validating supported product-model combinations
CHALLENGE

Where the intuition breaks

What this view leaves out

  • A registry centralizes selection but can become hidden global state unless entries, precedence, lifecycle, and failure behavior are explicit.
CONNECT

Where this concept sits

Follow the strongest prerequisites, applications, extensions, and contrasts.

Connections for Product and Pricer Registry

Built on · Pricing Library Architecture (Instrument–Market–Model–Pricer)

A product–pricer registry operationalises the separation between instrument definitions and pricing implementations.

Explore concept
SOURCES

References

  1. Python Documentation, importlib.metadata entry points (opens in a new tab)
← Explore all concepts