flyweight-pattern

Official

Conserve memory by sharing object state.

AuthorPatternsDev
Version1.0.0
Installs0

System Documentation

What problem does it solve?

The flyweight pattern reduces memory usage by sharing intrinsic state across many similar objects, avoiding duplication.

Core Features & Use Cases

  • Separate intrinsic and extrinsic state and cache shared instances with a Map to reuse them across copies.
  • Apply to scenarios with large collections of similar objects (e.g., books) where many instances share core properties.

Quick Start

Reuse a single intrinsic Book instance for multiple copies by caching by ISBN.

Dependency Matrix

Required Modules

None required

Components

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: flyweight-pattern
Download link: https://github.com/PatternsDev/skills/archive/main.zip#flyweight-pattern

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.