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

OvalBuilder Validation Weaving #1

Closed
vjkoskela opened this issue Dec 23, 2015 · 2 comments
Closed

OvalBuilder Validation Weaving #1

vjkoskela opened this issue Dec 23, 2015 · 2 comments

Comments

@vjkoskela
Copy link
Member

Currently, OvalBuilder invokes validation on build() directly resulting in significant performance loss due to reflection.

The first option is to leverage OVal's AspectJ validation using a guard annotation. Theoretically, this could be employed very quickly by disabling automatic validation (e.g. setInvariantsEnabled(false)) and then marking build() with @PreValidateThis. However, whether this works cleanly out of the box is largely unknown.

The more involved alternative would be to write a compile-time weaver much like we did for LogbackSteno's line and method injection. This should not be particularly onerous if we continue to rely on OVal for the annotations and validation logic. This is a more predictable solution but with only a modest amount of work.

The third alternative would be to remove OVal entirely and switch to JSR303 annotations with our own compile-time weaver. This is the most work, although it results in a solution that is entirely decoupled from OVal completely within our control.

@vjkoskela
Copy link
Member Author

There is a preview of an implementation for this in #18.

@vjkoskela
Copy link
Member Author

This was addressed with #18; remaining enhancements/improvements logged as separate issues.

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