factory-pattern
CommunityCentralize object creation for flexible instantiation
Authorerichugy
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Centralize object creation and hide construction complexity so consumers do not need to know concrete types, configuration wiring, or multi-step initialization logic.
Core Features & Use Cases
- Factory Functions: Simple factory functions that return different implementations based on environment or config, useful for loggers or storage backends.
- Registry / Abstract Factory: Open/closed registries that allow adding new product types without modifying consumers, ideal for plugin systems and notification channels.
- Builder Pattern: Fluent builders for objects with many optional fields or validation requirements, common in query construction and server configuration.
- Use Case: Replace scattered conditional construction code with a single factory layer to enforce invariants, provide defaults, and enable test doubles.
Quick Start
Generate a factory or builder for your target language that instantiates implementations based on a runtime configuration key such as storage_type or channel_type.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: factory-pattern Download link: https://github.com/erichugy/agentic.skills/archive/main.zip#factory-pattern Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.