Skip to content
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

Eagerly normalize AgObjectId values #426

Closed
andrus opened this issue Sep 9, 2019 · 1 comment
Closed

Eagerly normalize AgObjectId values #426

andrus opened this issue Sep 9, 2019 · 1 comment

Comments

@andrus
Copy link
Contributor

andrus commented Sep 9, 2019

Currently AgObjectId is allowed to contain values of the wrong type (not exactly matching the model attribute). Type conversion happens in asMap(AgEntity) method. There are a few problems with the current implementation:

  • Performance - Value conversion happens during consumption phase, hence may happen multiple times in different places.
  • Inconsistency: Ag.asMap(AgEntity) does conversion, Ag.get(String) does not
  • AgObjectId API is hard to use - it requires entity context to access ID.
  • AgObjectId can't be used as a map key because its internal state is not normalized.
  • Normalizer is very basic. Only has Number to Long converter (I guess this means most of the time people provide the correct values, and this is not a huge issue).

All of the above (except maybe the last item) points to the need to do normalization of values at the point of id creation.

The only test for normalizer use is PUT_IT.testSingle_LongId_Small(.)

@andrus
Copy link
Contributor Author

andrus commented Jun 24, 2023

This should no longer be an issue.

@andrus andrus closed this as completed Jun 24, 2023
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

No branches or pull requests

1 participant