Skip to content

Add support for sharing instances of NotNull NotBlank adapters #277

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
Jan 30, 2025

Conversation

rbygrave
Copy link
Contributor

When these are not customised and use the default group and default message, we can use shared "default adapters" instead of creating a new adapter for each instance.

This will be beneficial (reduce memory consumption) for the case where lots of NotNull & NotBlank etc used without any customisation of the groups or message.

This approach can be extended to also apply to other common validators like Email, UUID, AssertTrue, Positive etc.

When these are not customised and use the default group and default message, we can use shared "default adapters" instead of creating a new adapter for each instance.

This will be beneficial (reduce memory consumption) for the case where lots of NotNull & NotBlank etc used without any customisation of the groups or message.

This approach can be extended to also apply to other common validators like Email, UUID, AssertTrue, Positive etc.
@rbygrave rbygrave requested a review from SentryMan January 30, 2025 11:33
@rbygrave rbygrave self-assigned this Jan 30, 2025
@SentryMan SentryMan merged commit 1205844 into main Jan 30, 2025
7 checks passed
@SentryMan SentryMan deleted the feature/default-adapters-for-sharing branch January 30, 2025 15:08
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.

2 participants