Skip to content

Implement singleton pattern for SimpleMessageFormatter #450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 16, 2025

Conversation

making
Copy link
Owner

@making making commented Apr 16, 2025

Summary

  • Add singleton pattern to SimpleMessageFormatter to optimize resource usage
  • Keep backward compatibility with deprecated public constructor
  • Update all usages in the codebase to use getInstance() method

Implementation details

  • Added a private static final instance in SimpleMessageFormatter
  • Added a public getInstance() static method to access the singleton
  • Deprecated the public constructor while keeping it for backward compatibility
  • Updated ValidatorBuilder to use singleton instance
  • Updated all test files to use SimpleMessageFormatter.getInstance()
  • Added appropriate Javadoc documentation

This change should help with resource optimization while maintaining backward compatibility with existing code, allowing for a gradual migration to the singleton pattern.

🤖 Generated with Claude Code

making and others added 2 commits April 17, 2025 04:12
- Add getInstance() method to SimpleMessageFormatter
- Deprecate public constructor for backward compatibility
- Replace all direct instantiation with getInstance() calls
- Update documentation with singleton usage information

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@making making merged commit d85727f into develop Apr 16, 2025
4 checks passed
@making making deleted the feature/singleton-message-formatter branch April 17, 2025 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant