Hermes Wiki

FactoryMethod AbstractFactory

Delegates object creation to a method/class so the caller doesn't need to know the concrete type being constructed.

Why we need this / what value this brings

Lets calling code request 'a thing' without knowing or caring about the concrete class being constructed, so new types can be added without touching call sites.

When to use this

When a class hierarchy has multiple concrete implementations selected at runtime (e.g. by config or user choice).

How to use or implement this

Define a factory function/class that takes a discriminator (a provider name, a type string) and returns the right concrete instance behind a shared interface.

Research questions

  • The ProviderAdapter selection in AI/LLMIntegration (pick OpenAI/Anthropic/Groq/Ollama based on user choice) is a factory-method-shaped problem — worth modeling it explicitly as one.

Empty folder — drop notes, links, and findings here as you research.

Hermes Wiki