Csharp Flyweight Pattern
Implement flyweight pattern for memory optimization
Risk Level
MEDIUM
Core Rules
- Protect shared state
- ensure thread safety
- Test thoroughly before deploying
Response Pattern
When Using This Skill
- Implement flyweights
- Validate the implementation
- Test edge cases and error conditions
- Ensure performance meets requirements
Usage Contexts
- Memory optimization
- object pooling
What NOT to Do
- Shared state corruption
- thread safety issues
- Deploy without testing
Key Requirements
- Understand the use cases before application
- Follow the documented response pattern
- Validate results in the target environment
- Monitor for performance impact
Further Learning
Review related skills and documentation for deeper understanding of related systems and best practices.